From cd07f39b695b1eff73409992bf72c59b02227076 Mon Sep 17 00:00:00 2001 From: Benjamin Halko Date: Wed, 4 Oct 2023 12:16:56 -0700 Subject: [PATCH] fix: reset patches after patching --- lib/services/patcher_api.dart | 4 ++-- lib/ui/views/installer/installer_viewmodel.dart | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/services/patcher_api.dart b/lib/services/patcher_api.dart index f6c8aa3e..dc4ffabd 100644 --- a/lib/services/patcher_api.dart +++ b/lib/services/patcher_api.dart @@ -31,7 +31,7 @@ class PatcherAPI { File? outFile; Future initialize() async { - await _loadPatches(); + await loadPatches(); await _managerAPI.downloadIntegrations(); final Directory appCache = await getTemporaryDirectory(); _dataDir = await getExternalStorageDirectory() ?? appCache; @@ -62,7 +62,7 @@ class PatcherAPI { return _patches.where((patch) => patch.compatiblePackages.isEmpty).toList(); } - Future _loadPatches() async { + Future loadPatches() async { try { if (_patches.isEmpty) { _patches = await _managerAPI.getPatches(); diff --git a/lib/ui/views/installer/installer_viewmodel.dart b/lib/ui/views/installer/installer_viewmodel.dart index 3bfa5d24..8d54987d 100644 --- a/lib/ui/views/installer/installer_viewmodel.dart +++ b/lib/ui/views/installer/installer_viewmodel.dart @@ -148,9 +148,8 @@ class InstallerViewModel extends BaseViewModel { // Necessary to reset the state of patches by reloading them // in a later patching process. - // TODO(Benjamin): Fix this not working _managerAPI.patches.clear(); - await _managerAPI.getPatches(); + await _patcherAPI.loadPatches(); try { if (FlutterBackground.isBackgroundExecutionEnabled) {