Browse Source

improvements

Marino Faggiana 7 năm trước cách đây
mục cha
commit
8af1a2e418
1 tập tin đã thay đổi với 5 bổ sung9 xóa
  1. 5 9
      iOSClient/Notification/CCNotification.swift

+ 5 - 9
iOSClient/Notification/CCNotification.swift

@@ -170,19 +170,15 @@ class CCNotification: UITableViewController, OCNetworkingDelegate {
             let urlIcon = URL(string: notification.icon)
             var image : UIImage?
             
-            if urlIcon != nil {
-                let pathFileName = (appDelegate.directoryUser) + "/" + (urlIcon?.lastPathComponent)!
+            if let urlIcon = urlIcon {
+                let pathFileName = (appDelegate.directoryUser) + "/" + (urlIcon.lastPathComponent)
                 image = UIImage(contentsOfFile: pathFileName)
             }
             
-            if image == nil {
-                
-                cell.icon.image = CCGraphics.changeThemingColorImage(#imageLiteral(resourceName: "notification"), color: NCBrandColor.sharedInstance.brand)
-                //downloadImage(url: urlIcon)
-                
-            } else {
-                
+            if let image = image {
                 cell.icon.image = image
+            } else {
+                cell.icon.image = CCGraphics.changeThemingColorImage(#imageLiteral(resourceName: "notification"), color: NCBrandColor.sharedInstance.brand)
             }
             
             //