mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: Previously applied patches not selected when loading patch selection
This commit is contained in:
parent
5e6cc86c7e
commit
a5c9548b4d
@ -302,9 +302,16 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
|
||||
Future<void> loadSelectedPatches(BuildContext context) async {
|
||||
if (_managerAPI.isPatchesChangeEnabled()) {
|
||||
final List<String> selectedPatches = await _managerAPI.getSelectedPatches(
|
||||
locator<PatcherViewModel>().selectedApp!.packageName,
|
||||
);
|
||||
final List<String>? appliedPatches = _managerAPI
|
||||
.getPatchedApps()
|
||||
.firstWhereOrNull(
|
||||
(app) => app.packageName == selectedApp!.packageName,
|
||||
)
|
||||
?.appliedPatches;
|
||||
final List<String> selectedPatches = appliedPatches ??
|
||||
await _managerAPI.getSelectedPatches(
|
||||
selectedApp!.packageName,
|
||||
);
|
||||
if (selectedPatches.isNotEmpty) {
|
||||
this.selectedPatches.clear();
|
||||
this.selectedPatches.addAll(
|
||||
|
Loading…
Reference in New Issue
Block a user