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 {
|
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…
x
Reference in New Issue
Block a user