From a0d7a88a6b5a9ed46d0040ec2b47dcbc75db7f13 Mon Sep 17 00:00:00 2001 From: AmanRajSinghMourya Date: Mon, 28 Jul 2025 11:13:40 +0530 Subject: [PATCH] Fix add new album flow --- .../apps/photos/lib/models/search/search_types.dart | 13 ++++++++----- .../lib/ui/collections/album/vertical_list.dart | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mobile/apps/photos/lib/models/search/search_types.dart b/mobile/apps/photos/lib/models/search/search_types.dart index eb0cd0ea85..d5e27e671c 100644 --- a/mobile/apps/photos/lib/models/search/search_types.dart +++ b/mobile/apps/photos/lib/models/search/search_types.dart @@ -187,11 +187,14 @@ extension SectionTypeExtensions on SectionType { try { final Collection c = await CollectionsService.instance.createAlbum(text); - unawaited( - routeToPage( - context, - CollectionPage(CollectionWithThumbnail(c, null)), - ), + + // Close the dialog now so that it does not flash when leaving the album again. + Navigator.of(context).pop(); + + // ignore: unawaited_futures + await routeToPage( + context, + CollectionPage(CollectionWithThumbnail(c, null)), ); } catch (e, s) { Logger("CreateNewAlbumIcon") diff --git a/mobile/apps/photos/lib/ui/collections/album/vertical_list.dart b/mobile/apps/photos/lib/ui/collections/album/vertical_list.dart index aeb1fdc545..1c5ef2367d 100644 --- a/mobile/apps/photos/lib/ui/collections/album/vertical_list.dart +++ b/mobile/apps/photos/lib/ui/collections/album/vertical_list.dart @@ -142,7 +142,7 @@ class _AlbumVerticalListWidgetState extends State { }, showOnlyLoadingState: true, textCapitalization: TextCapitalization.words, - popnavAfterSubmission: false, + popnavAfterSubmission: true, ); if (result is Exception) { await showGenericErrorDialog(