marinofaggiana 4 năm trước cách đây
mục cha
commit
808a46cda7
1 tập tin đã thay đổi với 7 bổ sung13 xóa
  1. 7 13
      iOSClient/Networking/NCService.swift

+ 7 - 13
iOSClient/Networking/NCService.swift

@@ -79,20 +79,14 @@ class NCService: NSObject {
                     NCCommunication.shared.downloadContent(serverUrl: avatarUrl) { (account, data, errorCode, errorMessage) in
                         
                         if errorCode == 0 && account == self.appDelegate.account {
-                            
-                            DispatchQueue.global().async {
-                                
-                                if let image = UIImage(data: data!) {
-                                    
-                                    NCUtilityFileSystem.shared.deleteFile(filePath: fileNamePath)
-                                    
-                                    do {
-                                        if let data = image.pngData() {
-                                            try data.write(to: URL(fileURLWithPath: fileNamePath))
-                                        }
-                                    } catch {
-                                        print(error)
+                                                            
+                            if let image = UIImage(data: data!) {
+                                do {
+                                    if let data = image.pngData() {
+                                        try data.write(to: URL(fileURLWithPath: fileNamePath))
                                     }
+                                } catch {
+                                    print(error)
                                 }
                             }
                         }