[mobile][photos] Fix Add to Album in search section (#6675)

## Description
When creating a new album from the search tab, the album is created and
then it pop back to the search screen after sometime.

#### Before

https://github.com/user-attachments/assets/7e172227-5a35-4d7c-b0f3-e6afd46441ed

#### After


https://github.com/user-attachments/assets/c94eaac4-c51c-4dd3-a573-a8fd17221fec


## Tests
This commit is contained in:
Ashil
2025-07-31 22:30:58 +05:30
committed by GitHub
2 changed files with 9 additions and 6 deletions

View File

@@ -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")

View File

@@ -146,7 +146,7 @@ class _AlbumVerticalListWidgetState extends State<AlbumVerticalListWidget> {
},
showOnlyLoadingState: true,
textCapitalization: TextCapitalization.words,
popnavAfterSubmission: false,
popnavAfterSubmission: true,
);
if (result is Exception) {
await showGenericErrorDialog(