Skip to content

Commit

Permalink
fix: Fix patched APKs exports after installation
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Mar 4, 2024
1 parent 02722fc commit 1200360
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/services/manager_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ class ManagerAPI {
);
}

Future<void> rePatchedSavedApps() async {
Future<void> reAssessPatchedApps() async {
final List<PatchedApplication> patchedApps = getPatchedApps();

// Remove apps that are not installed anymore.
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/views/home/home_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class HomeViewModel extends BaseViewModel {
File? downloadedApk;

Future<void> initialize(BuildContext context) async {
_managerAPI.rePatchedSavedApps().then((_) => _getPatchedApps());
_managerAPI.reAssessPatchedApps().then((_) => getPatchedApps());
_currentManagerVersion = await _managerAPI.getCurrentManagerVersion();
if (!_managerAPI.getDownloadConsent()) {
await showDownloadConsent(context);
Expand Down Expand Up @@ -122,7 +122,7 @@ class HomeViewModel extends BaseViewModel {
locator<NavigationViewModel>().setIndex(1);
}

void _getPatchedApps() {
void getPatchedApps() {
patchedInstalledApps = _managerAPI.getPatchedApps().toList();
notifyListeners();
}
Expand Down
5 changes: 4 additions & 1 deletion lib/ui/views/installer/installer_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,10 @@ class InstallerViewModel extends BaseViewModel {
}

await _managerAPI.savePatchedApp(_app);
await locator<HomeViewModel>().initialize(context);

_managerAPI
.reAssessPatchedApps()
.then((_) => locator<HomeViewModel>().getPatchedApps());

update(1.0, 'Installed', 'Installed');
} else if (response == 3) {
Expand Down

0 comments on commit 1200360

Please sign in to comment.