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

fix

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 жил өмнө
parent
commit
d02623d0e5

+ 10 - 10
Widget/Dashboard/DashboardData.swift

@@ -171,20 +171,20 @@ func getDashboardDataEntry(intent: Applications, isPreview: Bool, displaySize: C
                         if let iconUrl = item.iconUrl, let url = URL(string: iconUrl) {
                             var size: CGFloat = 128
                             if let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) {
+
+                                let path = (urlComponents.path as NSString)
+                                let pathComponents = path.components(separatedBy: "/")
                                 let queryItems = urlComponents.queryItems
+
                                 if let item = CCUtility.value(forKey: "fileId", fromQueryItems: queryItems) {
                                     iconFileName = item
-                                } else {
-                                    let path = (urlComponents.path as NSString)
-                                    let components = path.components(separatedBy: "/")
-                                    if components[1] == "avatar", components.count == 4 {
-                                        iconFileName = components[2]
-                                        if let int = Int(components[3]) {
-                                            size = CGFloat(int)
-                                        }
-                                    } else {
-                                        iconFileName = ((path.lastPathComponent) as NSString).deletingPathExtension
+                                } else if pathComponents[1] == "avatar" {
+                                    iconFileName = pathComponents[2]
+                                    if let int = Int(pathComponents[3]) {
+                                        size = CGFloat(int)
                                     }
+                                } else {
+                                    iconFileName = ((path.lastPathComponent) as NSString).deletingPathExtension
                                 }
                             }
                             let semaphore = DispatchSemaphore(value: 0)

+ 1 - 1
Widget/Dashboard/DashboardWidgetView.swift

@@ -116,7 +116,7 @@ struct DashboardWidgetView: View {
                             Link(destination: URL(string: element.link)! , label: {
                                 
                                 Text(element.text)
-                                    .font(.system(size: 18))
+                                    .font(.system(size: 15))
                                     .padding(7)
                                     .background(brandColor)
                                     .foregroundColor(brandTextColor)