From dbb40a4a5b522f537b86de6b5b0780303719887f Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 21 Jun 2024 10:41:11 -0300 Subject: [PATCH] Only attempt to do a manual app backup, if it is actually enabled --- .../stevesoltys/seedvault/settings/SettingsViewModel.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsViewModel.kt b/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsViewModel.kt index cf1fd610..c69ec7a0 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsViewModel.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsViewModel.kt @@ -224,12 +224,13 @@ internal class SettingsViewModel( internal fun backupNow() { viewModelScope.launch(Dispatchers.IO) { + val isAppBackupEnabled = backupManager.isBackupEnabled if (settingsManager.isStorageBackupEnabled()) { val i = Intent(app, StorageBackupService::class.java) - // this starts an app backup afterwards - i.putExtra(EXTRA_START_APP_BACKUP, true) + // this starts an app backup afterwards (if enabled) + i.putExtra(EXTRA_START_APP_BACKUP, isAppBackupEnabled) startForegroundService(app, i) - } else { + } else if (isAppBackupEnabled) { AppBackupWorker.scheduleNow(app, reschedule = !pluginManager.isOnRemovableDrive) } }