diff --git a/mobile/assets/i18n/en-US.json b/mobile/assets/i18n/en-US.json index bcc835a86..84fa887b4 100644 --- a/mobile/assets/i18n/en-US.json +++ b/mobile/assets/i18n/en-US.json @@ -143,7 +143,7 @@ "daily_title_text_date_year": "E, MMM dd, yyyy", "date_format": "E, LLL d, y • h:mm a", "delete_dialog_alert": "These items will be permanently deleted from Immich and from your device", - "delete_dialog_alert_local": "These items will be permanently deleted from your device", + "delete_dialog_alert_local": "These items will be permanently removed from your device", "delete_dialog_cancel": "Cancel", "delete_dialog_ok": "Delete", "delete_dialog_title": "Delete Permanently", diff --git a/mobile/lib/modules/home/ui/control_bottom_app_bar.dart b/mobile/lib/modules/home/ui/control_bottom_app_bar.dart index 440fb1523..3bb161aba 100644 --- a/mobile/lib/modules/home/ui/control_bottom_app_bar.dart +++ b/mobile/lib/modules/home/ui/control_bottom_app_bar.dart @@ -15,7 +15,8 @@ class ControlBottomAppBar extends ConsumerWidget { final void Function() onShare; final void Function() onFavorite; final void Function() onArchive; - final void Function(bool localOnly) onDelete; + final void Function() onDelete; + final void Function() onDeleteLocal; final Function(Album album) onAddToAlbum; final void Function() onCreateNewAlbum; final void Function() onUpload; @@ -31,6 +32,7 @@ class ControlBottomAppBar extends ConsumerWidget { required this.onFavorite, required this.onArchive, required this.onDelete, + required this.onDeleteLocal, required this.sharedAlbums, required this.albums, required this.onAddToAlbum, @@ -80,12 +82,12 @@ class ControlBottomAppBar extends ConsumerWidget { context: context, builder: (BuildContext context) { return DeleteDialog( - onDelete: () => onDelete(false), + onDelete: onDelete, ); }, ); } else { - onDelete(false); + onDelete(); } } : null, @@ -103,7 +105,7 @@ class ControlBottomAppBar extends ConsumerWidget { builder: (BuildContext context) { return DeleteDialog( content: 'delete_dialog_alert_local', - onDelete: () => onDelete(true), + onDelete: onDeleteLocal, ); }, ); diff --git a/mobile/lib/modules/home/views/home_page.dart b/mobile/lib/modules/home/views/home_page.dart index dfec89e47..b6e7e3ddc 100644 --- a/mobile/lib/modules/home/views/home_page.dart +++ b/mobile/lib/modules/home/views/home_page.dart @@ -166,16 +166,19 @@ class HomePage extends HookConsumerWidget { void onDeleteLocal() async { processing.value = true; try { + final mergedIds = selection.value + .where((a) => a.storage == AssetState.merged) + .toList(); + final isDeleted = await ref .read(assetProvider.notifier) - .deleteLocalAssets(selection.value); + .deleteLocalAssets(mergedIds); if (isDeleted) { - final assetOrAssets = - selection.value.length > 1 ? 'assets' : 'asset'; + final assetOrAssets = mergedIds.length > 1 ? 'assets' : 'asset'; ImmichToast.show( context: context, msg: - '${selection.value.length} $assetOrAssets deleted permanently from your device', + '${mergedIds.length} $assetOrAssets removed permanently from your device', gravity: ToastGravity.BOTTOM, ); } @@ -354,8 +357,8 @@ class HomePage extends HookConsumerWidget { onShare: onShareAssets, onFavorite: onFavoriteAssets, onArchive: onArchiveAsset, - onDelete: (bool localOnly) => - localOnly ? onDeleteLocal() : onDelete(), + onDelete: onDelete, + onDeleteLocal: onDeleteLocal, onAddToAlbum: onAddToAlbum, albums: albums, sharedAlbums: sharedAlbums,