瀏覽代碼

Move created links at bottom in gallery + shared sections

Neeraj Gupta 2 年之前
父節點
當前提交
7bd3d5a447
共有 2 個文件被更改,包括 13 次插入5 次删除
  1. 3 3
      lib/ui/collections_gallery_widget.dart
  2. 10 2
      lib/ui/shared_collections_gallery.dart

+ 3 - 3
lib/ui/collections_gallery_widget.dart

@@ -114,12 +114,12 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
     // during create link flow for selected files
     // during create link flow for selected files
     final ListMatch<CollectionWithThumbnail> potentialSharedLinkCollection =
     final ListMatch<CollectionWithThumbnail> potentialSharedLinkCollection =
         favMathResult.unmatched.splitMatch(
         favMathResult.unmatched.splitMatch(
-      (e) => (e.collection.isSharedFilesCollection() &&
-          (e.collection.publicURLs?.isNotEmpty ?? false)),
+      (e) => (e.collection.isSharedFilesCollection()),
     );
     );
 
 
     return favMathResult.matched +
     return favMathResult.matched +
-        potentialSharedLinkCollection.unmatched;
+        potentialSharedLinkCollection.unmatched +
+        potentialSharedLinkCollection.matched;
   }
   }
 
 
   Widget _getCollectionsGalleryWidget(
   Widget _getCollectionsGalleryWidget(

+ 10 - 2
lib/ui/shared_collections_gallery.dart

@@ -91,8 +91,16 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
           }
           }
         }
         }
         outgoing.sort((first, second) {
         outgoing.sort((first, second) {
-          return second.collection.updationTime
-              .compareTo(first.collection.updationTime);
+          if (second.collection.isSharedFilesCollection() ==
+              first.collection.isSharedFilesCollection()) {
+            return second.collection.updationTime
+                .compareTo(first.collection.updationTime);
+          } else {
+            if (first.collection.isSharedFilesCollection()) {
+              return 1;
+            }
+            return -1;
+          }
         });
         });
         incoming.sort((first, second) {
         incoming.sort((first, second) {
           return second.collection.updationTime
           return second.collection.updationTime