diff --git a/.idea/libraries/Flutter_Plugins.xml b/.idea/libraries/Flutter_Plugins.xml index aa27351..4f01fb6 100644 --- a/.idea/libraries/Flutter_Plugins.xml +++ b/.idea/libraries/Flutter_Plugins.xml @@ -30,11 +30,11 @@ - + diff --git a/app/lib/ui/flow/home/home_screen.dart b/app/lib/ui/flow/home/home_screen.dart index 305b3d0..c08a7f2 100644 --- a/app/lib/ui/flow/home/home_screen.dart +++ b/app/lib/ui/flow/home/home_screen.dart @@ -221,16 +221,17 @@ class _HomeScreenState extends ConsumerState { } return AppMediaItem( key: ValueKey(media.id), - onTap: () { + onTap: () async { if (selectedMedias.isNotEmpty) { notifier.toggleMediaSelection(media); } else { - AppRouter.preview( + await AppRouter.preview( medias: medias.values .expand((element) => element) .toList(), startFrom: media.id) .push(context); + notifier.loadLocalMedia(); } }, onLongTap: () { diff --git a/app/lib/ui/flow/media_preview/media_preview_view_model.dart b/app/lib/ui/flow/media_preview/media_preview_view_model.dart index 584b236..095518c 100644 --- a/app/lib/ui/flow/media_preview/media_preview_view_model.dart +++ b/app/lib/ui/flow/media_preview/media_preview_view_model.dart @@ -86,6 +86,9 @@ class MediaPreviewStateNotifier extends StateNotifier { Future deleteMediaFromLocal(String id) async { try { await _localMediaService.deleteMedias([id]); + state = state.copyWith( + medias: state.medias.where((element) => element.id != id).toList(), + ); } catch (error) { state = state.copyWith(error: error); }