diff --git a/app/src/main/java/app/revanced/manager/ui/screen/PatcherScreen.kt b/app/src/main/java/app/revanced/manager/ui/screen/PatcherScreen.kt index af09bfa5..a80b49a2 100644 --- a/app/src/main/java/app/revanced/manager/ui/screen/PatcherScreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screen/PatcherScreen.kt @@ -55,6 +55,7 @@ import app.revanced.manager.ui.model.StepCategory import app.revanced.manager.ui.viewmodel.PatcherViewModel import app.revanced.manager.util.APK_MIMETYPE import app.revanced.manager.util.EventEffect +import app.revanced.manager.util.toast @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -76,11 +77,10 @@ fun PatcherScreen( var showInstallPicker by rememberSaveable { mutableStateOf(false) } var showDismissConfirmationDialog by rememberSaveable { mutableStateOf(false) } - fun onPageBack() { - if(patcherSucceeded == null) - showDismissConfirmationDialog = true - else - onLeave() + fun onPageBack() = when { + patcherSucceeded == null -> showDismissConfirmationDialog = true + viewModel.isInstalling -> context.toast(context.getString(R.string.patcher_install_in_progress)) + else -> onLeave() } BackHandler(onBack = ::onPageBack) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3ae245de..3eee6738 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -318,6 +318,7 @@ Tap to return to the patcher Stop patcher Are you sure you want to stop the patching process? + Installation is in progress. Please wait Execute patches Execute %s Failed to execute %s