feat: add toast feedback to the bundle update button

This commit is contained in:
Ax333l
2024-01-21 14:34:18 +01:00
committed by oSumAtrIX
parent e1647fdef0
commit ea50e65ab1
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))
}
}
}