From 6f34c5e894beb2ac172d00c3d08a43e6388486b3 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 31 Dec 2023 09:33:19 -0500 Subject: [PATCH] Prevent creating backups with no valid options selected --- .../more/settings/screen/data/CreateBackupScreen.kt | 1 + .../eu/kanade/tachiyomi/data/backup/create/BackupOptions.kt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/data/CreateBackupScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/data/CreateBackupScreen.kt index 20cd8d4e3..a45fd374e 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/data/CreateBackupScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/data/CreateBackupScreen.kt @@ -68,6 +68,7 @@ class CreateBackupScreen : Screen() { LazyColumnWithAction( contentPadding = contentPadding, actionLabel = stringResource(MR.strings.action_create), + actionEnabled = state.options.anyEnabled(), onClickAction = { if (!BackupCreateJob.isManualJobRunning(context)) { try { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupOptions.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupOptions.kt index dbb848500..868458b8a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupOptions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupOptions.kt @@ -26,6 +26,8 @@ data class BackupOptions( privateSettings, ) + fun anyEnabled() = libraryEntries || appSettings || sourceSettings + companion object { val libraryOptions = persistentListOf( Entry(