mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 12:47:37 +02:00
revert: "feat: improve predictive back (#1487)"
This reverts commit 06ff36c836
.
Signed-off-by: validcube <pun.butrach@gmail.com>
This commit is contained in:
@ -489,38 +489,25 @@ class InstallerViewModel extends BaseViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
bool canPop() {
|
||||
return !isPatching;
|
||||
}
|
||||
|
||||
void onBackButtonInvoked(BuildContext context) {
|
||||
if (canPop()) {
|
||||
onPopInvoked(context, true);
|
||||
} else {
|
||||
onPopInvoked(context, false);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onPopInvoked(BuildContext context, bool didPop) async {
|
||||
if (didPop) {
|
||||
Future<bool> onWillPop(BuildContext context) async {
|
||||
if (isPatching) {
|
||||
if (!cancel) {
|
||||
cleanPatcher();
|
||||
cancel = true;
|
||||
_toast.showBottom('installerView.pressBackAgain');
|
||||
} else if (!isCanceled) {
|
||||
await stopPatcher();
|
||||
} else {
|
||||
_patcherAPI.cleanPatcher();
|
||||
}
|
||||
screenshotCallback.dispose();
|
||||
Navigator.of(context).pop();
|
||||
} else {
|
||||
if (isPatching) {
|
||||
if (!cancel) {
|
||||
cancel = true;
|
||||
_toast.showBottom('installerView.pressBackAgain');
|
||||
} else if (!isCanceled) {
|
||||
await stopPatcher();
|
||||
} else {
|
||||
_toast.showBottom('installerView.noExit');
|
||||
}
|
||||
_toast.showBottom('installerView.noExit');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!cancel) {
|
||||
cleanPatcher();
|
||||
} else {
|
||||
_patcherAPI.cleanPatcher();
|
||||
}
|
||||
screenshotCallback.dispose();
|
||||
Navigator.of(context).pop();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user