Parcourir la source

widget fix order

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana il y a 2 ans
Parent
commit
94f1346f86
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      iOSClient/Data/NCManageDatabase+DashboardWidget.swift

+ 2 - 1
iOSClient/Data/NCManageDatabase+DashboardWidget.swift

@@ -41,7 +41,8 @@ extension NCManageDatabase {
     func getDashboardWidgetApplications(account: String) -> [tableDashboardWidget] {
 
         let realm = try! Realm()
-        let results = realm.objects(tableDashboardWidget.self).filter("account == %@", account).sorted(byKeyPath: "title", ascending: true)
+        let sortProperties = [SortDescriptor(keyPath: "order", ascending: true), SortDescriptor(keyPath: "title", ascending: true)]
+        let results = realm.objects(tableDashboardWidget.self).filter("account == %@", account).sorted(by: sortProperties)
 
         return Array(results.map { tableDashboardWidget.init(value: $0) })
     }