Only attempt to do a manual app backup, if it is actually enabled

This commit is contained in:
Torsten Grote 2024-06-21 10:41:11 -03:00
parent 7d6ab6f8e0
commit dbb40a4a5b
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF

View file

@ -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)
}
}