瀏覽代碼

Fix

Signed-off-by: Marino Faggiana <8616947+marinofaggiana@users.noreply.github.com>
Marino Faggiana 1 年之前
父節點
當前提交
3aef337ecb
共有 1 個文件被更改,包括 3 次插入12 次删除
  1. 3 12
      iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

+ 3 - 12
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -320,21 +320,12 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
 
         guard let userInfo = notification.userInfo as NSDictionary?,
               let error = userInfo["error"] as? NKError else { return }
-        let onlyLocalCache: Bool = userInfo["onlyLocalCache"] as? Bool ?? false
 
         self.queryDB(isForced: true)
+        self.collectionView?.reloadData()
 
-        if error == .success, let indexPath = userInfo["indexPath"] as? [IndexPath], !indexPath.isEmpty, !onlyLocalCache {
-            collectionView?.performBatchUpdates({
-                collectionView?.deleteItems(at: indexPath)
-            }, completion: { _ in
-                self.collectionView?.reloadData()
-            })
-        } else {
-            if error != .success {
-                NCContentPresenter.shared.showError(error: error)
-            }
-            self.collectionView?.reloadData()
+        if error != .success {
+            NCContentPresenter.shared.showError(error: error)
         }
 
         if let hud = userInfo["hud"] as? JGProgressHUD {