Răsfoiți Sursa

widget fix order

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 ani în urmă
părinte
comite
94f1346f86
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  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) })
     }