Skip to content

Commit

Permalink
Hide install button when installing
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminHalko committed Jul 28, 2024
1 parent dc05099 commit e48013a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ fun PatcherScreen(

val patcherSucceeded by vm.patcherSucceeded.observeAsState(null)
val canInstall by remember { derivedStateOf { patcherSucceeded == true && (vm.installedPackageName != null || !vm.isInstalling) } }
val canSaveApk by remember { derivedStateOf { patcherSucceeded == true && (vm.installedPackageName != null) } }
var showInstallPicker by rememberSaveable { mutableStateOf(false) }

val steps by remember {
Expand Down Expand Up @@ -107,7 +108,7 @@ fun PatcherScreen(
actions = {
IconButton(
onClick = { exportApkLauncher.launch("${vm.packageName}.apk") },
enabled = canInstall
enabled = canSaveApk
) {
Icon(Icons.Outlined.Save, stringResource(id = R.string.save_apk))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ class PatcherViewModel(
}

installerStatusDialogModel.packageInstallerStatus = pmStatus

isInstalling = false
}

UninstallService.APP_UNINSTALL_ACTION -> {
Expand Down Expand Up @@ -367,7 +369,7 @@ class PatcherViewModel(
}
}
}
} finally {
} catch(_: Exception) {
isInstalling = false
}
}
Expand Down

0 comments on commit e48013a

Please sign in to comment.