BG update toggle has an effect

This commit is contained in:
Imran Remtulla
2023-08-22 19:57:42 -04:00
parent 5307fd0901
commit 6785708661
4 changed files with 23 additions and 16 deletions

View File

@@ -147,7 +147,8 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async {
cancelExisting: true);
App? newApp = await appsProvider.checkUpdate(appId);
if (newApp != null) {
if (!(await appsProvider.canInstallSilently(app!.app))) {
if (!(await appsProvider.canInstallSilently(
app!.app, settingsProvider))) {
notificationsProvider.notify(
UpdateNotification([newApp], id: newApp.id.hashCode - 1));
} else {
@@ -198,7 +199,8 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async {
try {
logs.add(
'BG update task $taskId: Attempting to update $appId in the background.');
await appsProvider.downloadAndInstallLatestApps([appId], null,
await appsProvider.downloadAndInstallLatestApps(
[appId], null, settingsProvider,
notificationsProvider: notificationsProvider);
} catch (e) {
logs.add(