From 0a7fd03df7ba9efad425570715ca2b4a0126d862 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Thu, 2 Jan 2025 21:16:50 +0530 Subject: [PATCH] [mob][photos] Fix move/add to album UX issue --- .../ui/collections/album/vertical_list.dart | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mobile/lib/ui/collections/album/vertical_list.dart b/mobile/lib/ui/collections/album/vertical_list.dart index 825bbbdbd4..17a0308ce0 100644 --- a/mobile/lib/ui/collections/album/vertical_list.dart +++ b/mobile/lib/ui/collections/album/vertical_list.dart @@ -40,8 +40,8 @@ class AlbumVerticalListWidget extends StatelessWidget { this.sharedFiles, this.searchQuery, this.shouldShowCreateAlbum, { - Key? key, - }) : super(key: key); + super.key, + }); final _logger = Logger("CollectionsListWidgetState"); final CollectionActions _collectionActions = @@ -102,11 +102,12 @@ class AlbumVerticalListWidget extends StatelessWidget { title: S.of(context).albumTitle, submitButtonLabel: S.of(context).ok, hintText: S.of(context).enterAlbumName, - onSubmit: (name) { - return _nameAlbum(context, name); + onSubmit: (name) async { + return await _nameAlbum(context, name); }, showOnlyLoadingState: true, textCapitalization: TextCapitalization.words, + popnavAfterSubmission: false, ); if (result is Exception) { await showGenericErrorDialog( @@ -164,7 +165,11 @@ class AlbumVerticalListWidget extends StatelessWidget { "Album '" + albumName + "' created.", ); } - _navigateToCollection( + + Navigator.pop(context); + Navigator.pop(context); + + await _navigateToCollection( context, collection, hasVerifiedLock: hasVerifiedLock, @@ -220,7 +225,9 @@ class AlbumVerticalListWidget extends StatelessWidget { ); } if (shouldNavigateToCollection) { - _navigateToCollection( + Navigator.pop(context); + + await _navigateToCollection( context, item, hasVerifiedLock: hasVerifiedLock, @@ -258,13 +265,12 @@ class AlbumVerticalListWidget extends StatelessWidget { } } - void _navigateToCollection( + Future _navigateToCollection( BuildContext context, Collection collection, { bool hasVerifiedLock = false, - }) { - Navigator.pop(context); - routeToPage( + }) async { + await routeToPage( context, CollectionPage( CollectionWithThumbnail(collection, null),