Marino Faggiana 8 år sedan
förälder
incheckning
5f0e5aa5fb
2 ändrade filer med 16 tillägg och 18 borttagningar
  1. 1 1
      iOSClient/FileSystem/NCManageDatabase.swift
  2. 15 17
      iOSClient/Main/CCMore.swift

+ 1 - 1
iOSClient/FileSystem/NCManageDatabase.swift

@@ -376,7 +376,7 @@ class NCManageDatabase: NSObject {
         
         let realm = try! Realm()
         
-        let results = realm.objects(tableExternalSites.self).filter("account = '\(account)')")
+        let results = realm.objects(tableExternalSites.self).filter("account = '\(account)'")
         try! realm.write {
             realm.delete(results)
         }

+ 15 - 17
iOSClient/Main/CCMore.swift

@@ -107,26 +107,24 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         // External 
         menuExternalSite = NCManageDatabase.sharedInstance.getAllExternalSitesWithPredicate(NSPredicate(format: "(account == '\(appDelegate.activeAccount!)')"))
         
-        if (menuExternalSite != nil) {
-            for table in menuExternalSite! {
+        for table in menuExternalSite! {
             
-                item = OCExternalSites.init()
+            item = OCExternalSites.init()
             
-                item.name = table.name
-                item.url = table.url
-                item.icon = table.icon
+            item.name = table.name
+            item.url = table.url
+            item.icon = table.icon
             
-                if (table.type == "link") {
-                    item.icon = "moreExternalSite"
-                    functionMenu.append(item)
-                }
-                if (table.type == "settings") {
-                    item.icon = "moreSettingsExternalSite"
-                    settingsMenu.append(item)
-                }
-                if (table.type == "quota") {
-                    quotaMenu.append(item)
-                }
+            if (table.type == "link") {
+                item.icon = "moreExternalSite"
+                functionMenu.append(item)
+            }
+            if (table.type == "settings") {
+                item.icon = "moreSettingsExternalSite"
+                settingsMenu.append(item)
+            }
+            if (table.type == "quota") {
+                quotaMenu.append(item)
             }
         }