Переглянути джерело

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 роки тому
батько
коміт
70c26914f4

+ 3 - 5
Widget/Dashboard/DashboardData.swift

@@ -157,7 +157,7 @@ func getDashboardDataEntry(intent: Applications?, isPreview: Bool, displaySize:
                         var iconFileName: String?
 
                         if let iconUrl = item.iconUrl, let url = URL(string: iconUrl) {
-                            var size: CGFloat = 128
+                            var size = CGFloat(NCGlobal.shared.sizeIcon)
                             if let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) {
 
                                 let path = (urlComponents.path as NSString)
@@ -168,15 +168,13 @@ func getDashboardDataEntry(intent: Applications?, isPreview: Bool, displaySize:
                                     iconFileName = item
                                 } else if pathComponents[1] == "avatar" {
                                     iconFileName = pathComponents[2]
-                                    if let int = Int(pathComponents[3]) {
-                                        size = CGFloat(int)
-                                    }
+                                    size = CGFloat(NCGlobal.shared.avatarSize)
                                 } else {
                                     iconFileName = ((path.lastPathComponent) as NSString).deletingPathExtension
                                 }
                             }
                             let semaphore = DispatchSemaphore(value: 0)
-                            NCUtility.shared.getImageUserData(url: url, fileName: iconFileName , size: size) { image in
+                            NCUtility.shared.getImageUserData(url: url, fileName: iconFileName, size: size) { image in
                                 if let image = image {
                                     icon = image
                                 }

+ 2 - 3
iOSClient/Networking/NCNetworking.swift

@@ -168,10 +168,9 @@ import Photos
 
         #if !EXTENSION
         defer {
+            NKCommon.shared.writeLog("[INFO] Check trusted challenge:\(isTrusted)")
             if !isTrusted {
-                DispatchQueue.main.async {
-                    (UIApplication.shared.delegate as? AppDelegate)?.trustCertificateError(host: host)
-                }
+                DispatchQueue.main.async { (UIApplication.shared.delegate as? AppDelegate)?.trustCertificateError(host: host) }
             }
         }
         #endif

+ 1 - 1
iOSClient/Networking/NCService.swift

@@ -277,7 +277,7 @@ class NCService: NSObject {
                 NCManageDatabase.shared.addDashboardWidget(account: account, dashboardWidgets: dashboardWidgets)
                 for widget in dashboardWidgets {
                     if let url = URL(string: widget.iconUrl), let fileName = widget.iconClass {
-                        NCUtility.shared.getImageUserData(url: url, fileName: fileName, size: 128)
+                        NCUtility.shared.getImageUserData(url: url, fileName: fileName, size: CGFloat(NCGlobal.shared.sizeIcon))
                     }
                 }
             }

+ 1 - 1
iOSClient/Utility/NCUtility.swift

@@ -996,7 +996,7 @@ class NCUtility: NSObject {
     }
     
     func getImageUserData(url: URL, fileName: String?, size: CGFloat, completition: @escaping (_ image: UIImage?) -> () = { _ in }) {
-        
+
         let size = CGSize(width: size, height: size)
         let options = NKRequestOptions(queue: NKCommon.shared.backgroundQueue)