Эх сурвалжийг харах

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 жил өмнө
parent
commit
2e7104b160

+ 9 - 2
iOSClient/Data/NCDataSource.swift

@@ -75,6 +75,14 @@ class NCDataSource: NSObject {
 
         self.sectionsValue = metadatasSource.map { getSectionValue(metadata: $0) }
         self.sectionsValue = Array(Set(self.sectionsValue))
+        self.sectionsValue = self.sectionsValue.sorted {
+            if self.ascending {
+                return $0 < $1
+            } else {
+                return $0 > $1
+            }
+        }
+        /* TEST
         if let providers = self.providers {
             var sectionsDictionary: [String:Int] = [:]
             for section in self.sectionsValue {
@@ -85,8 +93,6 @@ class NCDataSource: NSObject {
             self.sectionsValue.removeAll()
             let sectionsDictionarySorted = sectionsDictionary.sorted(by: { $0.value > $1.value } )
             for section in sectionsDictionarySorted { self.sectionsValue.append(section.key) }
-            print(sectionsDictionarySorted)
-            print(self.sectionsValue)
         } else {
             self.sectionsValue = self.sectionsValue.sorted {
                 if self.ascending {
@@ -96,6 +102,7 @@ class NCDataSource: NSObject {
                 }
             }
         }
+        */
     }
 
     internal func createMetadataForSection(sectionValue: String) {

+ 1 - 1
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1907,7 +1907,7 @@ extension NCCollectionViewCommon: UICollectionViewDelegateFlowLayout {
             }
         }
 
-        if section == 0 && dataSource.numberOfSections() > 1 {
+        if section == 0 && dataSource.numberOfSections() > 1 || isSearching {
             return (getHeaderHeight(), headerRichWorkspace, NCGlobal.shared.heightSection)
         } else if section == 0 && dataSource.numberOfSections() == 1 {
             return (getHeaderHeight(), headerRichWorkspace, 0)