fix: show install button when installation has been cancelled

This commit is contained in:
Robert 2025-01-29 15:11:15 +01:00 committed by oSumAtrIX
parent f59d57499d
commit b6ad686a26
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -108,14 +108,19 @@ class UpdateViewModel(
val extra = val extra =
intent.getStringExtra(InstallService.EXTRA_INSTALL_STATUS_MESSAGE)!! intent.getStringExtra(InstallService.EXTRA_INSTALL_STATUS_MESSAGE)!!
if (pmStatus == PackageInstaller.STATUS_SUCCESS) { when(pmStatus) {
app.toast(app.getString(R.string.install_app_success)) PackageInstaller.STATUS_SUCCESS -> {
state = State.SUCCESS app.toast(app.getString(R.string.install_app_success))
} else { state = State.SUCCESS
state = State.FAILED }
// TODO: handle install fail with a popup PackageInstaller.STATUS_FAILURE_ABORTED -> {
installError = extra state = State.CAN_INSTALL
app.toast(app.getString(R.string.install_app_fail, extra)) }
else -> {
app.toast(app.getString(R.string.install_app_fail, extra))
installError = extra
state = State.FAILED
}
} }
} }
} }