mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-12 18:04:28 +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 {
|
Future<void> loadSelectedPatches(BuildContext context) async {
|
||||||
if (_managerAPI.isPatchesChangeEnabled()) {
|
if (_managerAPI.isPatchesChangeEnabled()) {
|
||||||
final List<String> selectedPatches = await _managerAPI.getSelectedPatches(
|
final List<String>? appliedPatches = _managerAPI
|
||||||
locator<PatcherViewModel>().selectedApp!.packageName,
|
.getPatchedApps()
|
||||||
);
|
.firstWhereOrNull(
|
||||||
|
(app) => app.packageName == selectedApp!.packageName,
|
||||||
|
)
|
||||||
|
?.appliedPatches;
|
||||||
|
final List<String> selectedPatches = appliedPatches ??
|
||||||
|
await _managerAPI.getSelectedPatches(
|
||||||
|
selectedApp!.packageName,
|
||||||
|
);
|
||||||
if (selectedPatches.isNotEmpty) {
|
if (selectedPatches.isNotEmpty) {
|
||||||
this.selectedPatches.clear();
|
this.selectedPatches.clear();
|
||||||
this.selectedPatches.addAll(
|
this.selectedPatches.addAll(
|
||||||
|
|
Loading…
Reference in a new issue