Skip to content

Commit

Permalink
feat: add toast feedback to the bundle update button
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelen123 committed Jan 21, 2024
1 parent 0b9889e commit 607d8b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import app.revanced.manager.R
import app.revanced.manager.domain.bundles.PatchBundleSource
import app.revanced.manager.domain.bundles.RemotePatchBundle
import app.revanced.manager.domain.repository.PatchBundleRepository
import app.revanced.manager.util.toast
import app.revanced.manager.util.uiSafe
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -53,7 +54,10 @@ class DashboardViewModel(
R.string.source_download_fail,
RemotePatchBundle.updateFailMsg
) {
bundle.update()
if (bundle.update())
app.toast(app.getString(R.string.bundle_update_success, bundle.name))
else
app.toast(app.getString(R.string.bundle_update_unavailable, bundle.name))
}
}
}
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@
<string name="developer_options_description">Options for debugging issues</string>
<string name="bundle_input_name">Name</string>
<string name="bundle_input_source_url">Source URL</string>
<string name="bundle_update_success">Successfully updated %s</string>
<string name="bundle_update_unavailable">No update available for %s</string>
<string name="automatically_update">Automatically update</string>
<string name="automatically_update_description">Automatically update this bundle when ReVanced starts</string>
<string name="bundle_type">Bundle type</string>
Expand Down

0 comments on commit 607d8b6

Please sign in to comment.