diff --git a/mobile/lib/ui/viewer/gallery/gallery.dart b/mobile/lib/ui/viewer/gallery/gallery.dart index d895bc80fe..7af50e38f5 100644 --- a/mobile/lib/ui/viewer/gallery/gallery.dart +++ b/mobile/lib/ui/viewer/gallery/gallery.dart @@ -108,6 +108,7 @@ class GalleryState extends State { final _forceReloadEventSubscriptions = >[]; late String _logTag; bool _sortOrderAsc = false; + List _allFiles = []; @override void initState() { @@ -214,7 +215,7 @@ class GalleryState extends State { // group files into multiple groups and returns `true` if it resulted in a // gallery reload bool _onFilesLoaded(List files) { - SelectionState.of(context)?.allGalleryFiles = files; + _allFiles = files; final updatedGroupedFiles = widget.enableFileGrouping && widget.groupType.timeGrouping() @@ -249,6 +250,7 @@ class GalleryState extends State { @override Widget build(BuildContext context) { _logger.finest("Building Gallery ${widget.tagPrefix}"); + SelectionState.of(context)?.allGalleryFiles = _allFiles; if (!_hasLoadedFiles) { return widget.loadingWidget; }