diff --git a/mobile/lib/modules/backup/providers/backup.provider.dart b/mobile/lib/modules/backup/providers/backup.provider.dart index e71a8dbfd..bdb9eb4dd 100644 --- a/mobile/lib/modules/backup/providers/backup.provider.dart +++ b/mobile/lib/modules/backup/providers/backup.provider.dart @@ -77,6 +77,8 @@ class BackupNotifier extends StateNotifier { } void addExcludedAlbumForBackup(AssetPathEntity album) { + print("Excluded album: $album"); + if (state.selectedBackupAlbums.contains(album)) { removeAlbumForBackup(album); } diff --git a/mobile/lib/modules/backup/ui/album_info_card.dart b/mobile/lib/modules/backup/ui/album_info_card.dart index 370db0c3b..b523c713b 100644 --- a/mobile/lib/modules/backup/ui/album_info_card.dart +++ b/mobile/lib/modules/backup/ui/album_info_card.dart @@ -102,10 +102,12 @@ class AlbumInfoCard extends HookConsumerWidget { HapticFeedback.selectionClick(); if (isExcluded) { + // Remove from exclude album list ref .watch(backupProvider.notifier) .removeExcludedAlbumForBackup(albumInfo); } else { + // Add to exclude album list if (ref.watch(backupProvider).selectedBackupAlbums.length == 1 && ref .watch(backupProvider) @@ -120,6 +122,16 @@ class AlbumInfoCard extends HookConsumerWidget { return; } + if (albumInfo.id == 'isAll') { + ImmichToast.show( + context: context, + msg: 'Cannot exclude album contains all assets', + toastType: ToastType.error, + gravity: ToastGravity.BOTTOM, + ); + return; + } + ref .watch(backupProvider.notifier) .addExcludedAlbumForBackup(albumInfo);