Browse Source

fix: creating new album from search section stuck on loading state (#1665)

Ashil 1 year ago
parent
commit
e78c898a48
1 changed files with 7 additions and 3 deletions
  1. 7 3
      lib/models/search/search_types.dart

+ 7 - 3
lib/models/search/search_types.dart

@@ -1,3 +1,5 @@
+import "dart:async";
+
 import "package:flutter/material.dart";
 import "package:flutter/material.dart";
 import "package:logging/logging.dart";
 import "package:logging/logging.dart";
 import "package:photos/core/event_bus.dart";
 import "package:photos/core/event_bus.dart";
@@ -211,9 +213,11 @@ extension SectionTypeExtensions on SectionType {
               try {
               try {
                 final Collection c =
                 final Collection c =
                     await CollectionsService.instance.createAlbum(text);
                     await CollectionsService.instance.createAlbum(text);
-                await routeToPage(
-                  context,
-                  CollectionPage(CollectionWithThumbnail(c, null)),
+                unawaited(
+                  routeToPage(
+                    context,
+                    CollectionPage(CollectionWithThumbnail(c, null)),
+                  ),
                 );
                 );
               } catch (e, s) {
               } catch (e, s) {
                 Logger("CreateNewAlbumIcon")
                 Logger("CreateNewAlbumIcon")