mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-09 16:52:14 +01:00
fix: Select previously applied patches when loading patch selection (#1865)
This commit is contained in:
parent
232b702789
commit
7ef8f0454b
1 changed files with 10 additions and 3 deletions
|
@ -301,9 +301,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 a new issue