π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix bug in PinnedGroupHeader when gallery is reloaded or setState is called in gallery
ashilkn38e513587862
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dartindex 5cf15b5b98..7ef1616ff8 100644--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart@@ -597,16 +597,22 @@ class _PinnedGroupHeaderState extends State<PinnedGroupHeader> {@overridevoid initState() {super.initState();- widget.scrollController.addListener(_scrollControllerListener);+ widget.scrollController.addListener(_setCurrentGroupID);+ }++ @override+ void didUpdateWidget(covariant PinnedGroupHeader oldWidget) {+ super.didUpdateWidget(oldWidget);+ _setCurrentGroupID();}@overridevoid dispose() {- widget.scrollController.removeListener(_scrollControllerListener);+ widget.scrollController.removeListener(_setCurrentGroupID);super.dispose();}- void _scrollControllerListener() {+ void _setCurrentGroupID() {final normalizedScrollOffset = widget.scrollController.offset -widget.getSectionedListSliverRenderBoxYOffsetRelativeToStackRenderBox()!;@@ -654,13 +660,12 @@ class _PinnedGroupHeaderState extends State<PinnedGroupHeader> {Widget build(BuildContext context) {return currentGroupID != null? GroupHeaderWidget(- title: widget.galleryGroups.groupIdToheaderDataMap[currentGroupID!]- ?.groupType- .getTitle(- context,- widget.galleryGroups.groupIDToFilesMap[currentGroupID]!.first,- ) ??- '',+ title: widget.galleryGroups.groupIdToheaderDataMap[currentGroupID!]!+ .groupType+ .getTitle(+ context,+ widget.galleryGroups.groupIDToFilesMap[currentGroupID]!.first,+ ),gridSize: localSettings.getPhotoGridSize(),height: widget.galleryGroups.headerExtent,)