mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: Add missing confirmation dialog
This commit is contained in:
parent
48a739c94e
commit
7a1ba9dabf
@ -308,6 +308,7 @@
|
||||
"rootDialogTitle": "Error",
|
||||
|
||||
"unpatchDialogText": "Are you sure you want to unpatch this app?",
|
||||
"uninstallDialogText": "Are you sure you want to uninstall this app?",
|
||||
"rootDialogText": "App was installed with superuser permissions, but currently ReVanced Manager has no permissions.\nPlease grant superuser permissions first.",
|
||||
|
||||
"packageNameLabel": "Package name",
|
||||
|
@ -28,6 +28,7 @@ class AppInfoViewModel extends BaseViewModel {
|
||||
var isUninstalled = onlyUnpatch;
|
||||
|
||||
if (!onlyUnpatch) {
|
||||
// TODO(Someone): Wait for the app to uninstall successfully.
|
||||
isUninstalled = await DeviceApps.uninstallApp(app.packageName);
|
||||
}
|
||||
|
||||
@ -91,7 +92,7 @@ class AppInfoViewModel extends BaseViewModel {
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
uninstallApp(context, app, onlyUnpatch);
|
||||
uninstallApp(context, app, true);
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@ -101,8 +102,31 @@ class AppInfoViewModel extends BaseViewModel {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
uninstallApp(context, app, onlyUnpatch);
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText(
|
||||
'appInfoView.uninstallButton',
|
||||
),
|
||||
content: I18nText(
|
||||
'appInfoView.uninstallDialogText',
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: I18nText('noButton'),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
uninstallApp(context, app, false);
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('yesButton'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user