From 607d8b67c9bbdfea908a4c608a9b54fc50743835 Mon Sep 17 00:00:00 2001 From: Ax333l Date: Sun, 21 Jan 2024 14:34:18 +0100 Subject: [PATCH] feat: add toast feedback to the bundle update button --- .../app/revanced/manager/ui/viewmodel/DashboardViewModel.kt | 6 +++++- app/src/main/res/values/strings.xml | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/revanced/manager/ui/viewmodel/DashboardViewModel.kt b/app/src/main/java/app/revanced/manager/ui/viewmodel/DashboardViewModel.kt index ba52b82a..0d9c4dc0 100644 --- a/app/src/main/java/app/revanced/manager/ui/viewmodel/DashboardViewModel.kt +++ b/app/src/main/java/app/revanced/manager/ui/viewmodel/DashboardViewModel.kt @@ -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)) } } } \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index deecdb4d..bae85e41 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -273,6 +273,8 @@ Options for debugging issues Name Source URL + Successfully updated %s + No update available for %s Automatically update Automatically update this bundle when ReVanced starts Bundle type