浏览代码

Sort collection by name during Add/Move/Restore flow

Neeraj Gupta 3 年之前
父节点
当前提交
083c52fbca
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      lib/ui/create_collection_page.dart

+ 4 - 3
lib/ui/create_collection_page.dart

@@ -213,8 +213,8 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
       }
       }
     }
     }
     collectionsWithThumbnail.sort((first, second) {
     collectionsWithThumbnail.sort((first, second) {
-      return second.collection.updationTime
-          .compareTo(first.collection.updationTime);
+      return (first.collection.name ?? "")
+          .compareTo((second.collection.name ?? ""));
     });
     });
     return collectionsWithThumbnail;
     return collectionsWithThumbnail;
   }
   }
@@ -311,9 +311,10 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
         fromCollectionID,
         fromCollectionID,
         widget.selectedFiles.files?.toList(),
         widget.selectedFiles.files?.toList(),
       );
       );
+      await dialog.hide();
       RemoteSyncService.instance.sync(silently: true);
       RemoteSyncService.instance.sync(silently: true);
       widget.selectedFiles?.clearAll();
       widget.selectedFiles?.clearAll();
-      await dialog.hide();
+
       return true;
       return true;
     } on AssertionError catch (e, s) {
     } on AssertionError catch (e, s) {
       await dialog.hide();
       await dialog.hide();