File tree 1 file changed +13
-8
lines changed
app/src/main/java/app/revanced/manager/ui/viewmodel
1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -108,14 +108,19 @@ class UpdateViewModel(
108
108
val extra =
109
109
intent.getStringExtra(InstallService .EXTRA_INSTALL_STATUS_MESSAGE )!!
110
110
111
- if (pmStatus == PackageInstaller .STATUS_SUCCESS ) {
112
- app.toast(app.getString(R .string.install_app_success))
113
- state = State .SUCCESS
114
- } else {
115
- state = State .FAILED
116
- // TODO: handle install fail with a popup
117
- installError = extra
118
- app.toast(app.getString(R .string.install_app_fail, extra))
111
+ when (pmStatus) {
112
+ PackageInstaller .STATUS_SUCCESS -> {
113
+ app.toast(app.getString(R .string.install_app_success))
114
+ state = State .SUCCESS
115
+ }
116
+ PackageInstaller .STATUS_FAILURE_ABORTED -> {
117
+ state = State .CAN_INSTALL
118
+ }
119
+ else -> {
120
+ app.toast(app.getString(R .string.install_app_fail, extra))
121
+ installError = extra
122
+ state = State .FAILED
123
+ }
119
124
}
120
125
}
121
126
}
You can’t perform that action at this time.
0 commit comments