marinofaggiana 3 年之前
父节点
当前提交
0dea308992
共有 2 个文件被更改,包括 4 次插入8 次删除
  1. 4 7
      iOSClient/Networking/NCOperationQueue.swift
  2. 0 1
      iOSClient/Networking/NCService.swift

+ 4 - 7
iOSClient/Networking/NCOperationQueue.swift

@@ -492,15 +492,12 @@ class NCOperationDownloadAvatar: ConcurrentOperation {
                         }
                     }
                     
-                } else if errorCode == NCGlobal.shared.errorNotModified, let image = UIImage(contentsOfFile: self.fileNameLocalPath) {
+                } else if errorCode == NCGlobal.shared.errorNotModified {
                     #if !EXTENSION
-                    (UIApplication.shared.delegate as! AppDelegate).avatars[self.user] = image
-                    #endif
-                    if self.view is UICollectionView {
-                        (self.view as? UICollectionView)?.reloadData()
-                    } else if self.view is UITableView{
-                        (self.view as? UITableView)?.reloadData()
+                    if (UIApplication.shared.delegate as! AppDelegate).avatars[self.user] == nil, let image = UIImage(contentsOfFile: self.fileNameLocalPath) {
+                        (UIApplication.shared.delegate as! AppDelegate).avatars[self.user] = image
                     }
+                    #endif
                 }
                 
                 self.finish()

+ 0 - 1
iOSClient/Networking/NCService.swift

@@ -117,7 +117,6 @@ class NCService: NSObject {
                             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadAvatar, userInfo: nil)
                         } else if errorCode == NCGlobal.shared.errorNotModified, let image = UIImage(contentsOfFile: fileNameLocalPath) {
                             (UIApplication.shared.delegate as! AppDelegate).avatars[user] = image
-                            NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadAvatar, userInfo: nil)
                         }
                     }
                     self.requestServerCapabilities()