Browse Source

Move created links at bottom in gallery + shared sections

Neeraj Gupta 2 years ago
parent
commit
7bd3d5a447
2 changed files with 13 additions and 5 deletions
  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
     final ListMatch<CollectionWithThumbnail> potentialSharedLinkCollection =
         favMathResult.unmatched.splitMatch(
-      (e) => (e.collection.isSharedFilesCollection() &&
-          (e.collection.publicURLs?.isNotEmpty ?? false)),
+      (e) => (e.collection.isSharedFilesCollection()),
     );
 
     return favMathResult.matched +
-        potentialSharedLinkCollection.unmatched;
+        potentialSharedLinkCollection.unmatched +
+        potentialSharedLinkCollection.matched;
   }
 
   Widget _getCollectionsGalleryWidget(

+ 10 - 2
lib/ui/shared_collections_gallery.dart

@@ -91,8 +91,16 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
           }
         }
         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) {
           return second.collection.updationTime