Skip to content

Commit

Permalink
fix: reset patches after patching
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminHalko committed Oct 4, 2023
1 parent b07439d commit cd07f39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/services/patcher_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PatcherAPI {
File? outFile;

Future<void> initialize() async {
await _loadPatches();
await loadPatches();
await _managerAPI.downloadIntegrations();
final Directory appCache = await getTemporaryDirectory();
_dataDir = await getExternalStorageDirectory() ?? appCache;
Expand Down Expand Up @@ -62,7 +62,7 @@ class PatcherAPI {
return _patches.where((patch) => patch.compatiblePackages.isEmpty).toList();
}

Future<void> _loadPatches() async {
Future<void> loadPatches() async {
try {
if (_patches.isEmpty) {
_patches = await _managerAPI.getPatches();
Expand Down
3 changes: 1 addition & 2 deletions lib/ui/views/installer/installer_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cd07f39

Please sign in to comment.