π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Avoid using .of(context) in initState to stop exceptions from being thrown
ashilknff1e84d0d863
diff --git a/mobile/lib/ui/viewer/gallery/gallery.dart b/mobile/lib/ui/viewer/gallery/gallery.dartindex 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<Gallery> {final _forceReloadEventSubscriptions = <StreamSubscription<Event>>[];late String _logTag;bool _sortOrderAsc = false;+ List<EnteFile> _allFiles = [];@overridevoid initState() {@@ -214,7 +215,7 @@ class GalleryState extends State<Gallery> {// group files into multiple groups and returns `true` if it resulted in a// gallery reloadbool _onFilesLoaded(List<EnteFile> files) {- SelectionState.of(context)?.allGalleryFiles = files;+ _allFiles = files;final updatedGroupedFiles =widget.enableFileGrouping && widget.groupType.timeGrouping()@@ -249,6 +250,7 @@ class GalleryState extends State<Gallery> {@overrideWidget build(BuildContext context) {_logger.finest("Building Gallery ${widget.tagPrefix}");+ SelectionState.of(context)?.allGalleryFiles = _allFiles;if (!_hasLoadedFiles) {return widget.loadingWidget;}