mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-04-30 14:04:26 +02:00
feat: Also show new patches in the removed patches dialog (#2257)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
bd79496433
commit
8872165a99
@ -55,7 +55,8 @@
|
|||||||
"widgetTitle": "Patcher",
|
"widgetTitle": "Patcher",
|
||||||
"patchButton": "Patch",
|
"patchButton": "Patch",
|
||||||
"incompatibleArchWarningDialogText": "Patching on this architecture is not yet supported and might fail. Continue anyways?",
|
"incompatibleArchWarningDialogText": "Patching on this architecture is not yet supported and might fail. Continue anyways?",
|
||||||
"removedPatchesWarningDialogText": "The following patches have been removed since the last time you used them.\n\n${patches}\n\nContinue anyways?",
|
"removedPatchesWarningDialogText": "Removed patches since the last time you used them:\n\n${patches}\n\n${newPatches}Continue anyways?",
|
||||||
|
"addedPatchesDialogText": "Added patches since the last time you used them:\n\n${addedPatches}\n\n",
|
||||||
"requiredOptionDialogText": "Some patch options have to be set."
|
"requiredOptionDialogText": "Some patch options have to be set."
|
||||||
},
|
},
|
||||||
"appSelectorCard": {
|
"appSelectorCard": {
|
||||||
|
@ -28,6 +28,7 @@ class PatcherViewModel extends BaseViewModel {
|
|||||||
BuildContext? ctx;
|
BuildContext? ctx;
|
||||||
List<Patch> selectedPatches = [];
|
List<Patch> selectedPatches = [];
|
||||||
List<String> removedPatches = [];
|
List<String> removedPatches = [];
|
||||||
|
List<String> newPatches = [];
|
||||||
|
|
||||||
void navigateToAppSelector() {
|
void navigateToAppSelector() {
|
||||||
_navigationService.navigateTo(Routes.appSelectorView);
|
_navigationService.navigateTo(Routes.appSelectorView);
|
||||||
@ -59,6 +60,11 @@ class PatcherViewModel extends BaseViewModel {
|
|||||||
child: Text(
|
child: Text(
|
||||||
t.patcherView.removedPatchesWarningDialogText(
|
t.patcherView.removedPatchesWarningDialogText(
|
||||||
patches: removedPatches.join('\n'),
|
patches: removedPatches.join('\n'),
|
||||||
|
newPatches: newPatches.isNotEmpty
|
||||||
|
? t.patcherView.addedPatchesDialogText(
|
||||||
|
addedPatches: newPatches.join('\n'),
|
||||||
|
)
|
||||||
|
: '',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -188,14 +194,14 @@ class PatcherViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
if (savedPatchNames.isEmpty) {
|
if (savedPatchNames.isEmpty) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
return !savedPatchNames.contains(patch.name);
|
|
||||||
}
|
}
|
||||||
|
return !savedPatchNames.contains(patch.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> loadLastSelectedPatches() async {
|
Future<void> loadLastSelectedPatches() async {
|
||||||
this.selectedPatches.clear();
|
this.selectedPatches.clear();
|
||||||
removedPatches.clear();
|
removedPatches.clear();
|
||||||
|
newPatches.clear();
|
||||||
final List<String> selectedPatches =
|
final List<String> selectedPatches =
|
||||||
await _managerAPI.getSelectedPatches(selectedApp!.packageName);
|
await _managerAPI.getSelectedPatches(selectedApp!.packageName);
|
||||||
final List<Patch> patches =
|
final List<Patch> patches =
|
||||||
@ -236,6 +242,11 @@ class PatcherViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (final patch in patches) {
|
||||||
|
if (isPatchNew(patch)) {
|
||||||
|
newPatches.add('• ${patch.name}');
|
||||||
|
}
|
||||||
|
}
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user