feat: add toast feedback to the bundle update button

This commit is contained in:
Ax333l 2024-01-21 14:34:18 +01:00
parent 0b9889ea44
commit 607d8b67c9
No known key found for this signature in database
GPG Key ID: D2B4D85271127D23
2 changed files with 7 additions and 1 deletions

View File

@ -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
@ -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))
}
}
}

View File

@ -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>