marinofaggiana 4 years ago
parent
commit
6e1fbdbd43
2 changed files with 8 additions and 1 deletions
  1. 2 0
      iOSClient/Networking/NCNetworking.swift
  2. 6 1
      iOSClient/Transfers/NCTransfers.swift

+ 2 - 0
iOSClient/Networking/NCNetworking.swift

@@ -516,6 +516,8 @@ import Queuer
                         CCUtility.removeFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId))
                         NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                     }
+                    
+                    NotificationCenter.default.postOnMainThread(name: k_notificationCenter_uploadCancelFile, userInfo: ["metadata":metadata])
                 
                 } else if errorCode == 401 || errorCode == 403 {
                     

+ 6 - 1
iOSClient/Transfers/NCTransfers.swift

@@ -91,9 +91,12 @@ class NCTransfers: NCCollectionViewCommon  {
                         }, completion: { (_) in
                             self.collectionView?.reloadData()
                         })
+                    } else {
+                        reloadDataSource()
                     }
                     
-                } else {
+                } else if errorCode != NSURLErrorCancelled {
+                    
                     if let row = dataSource?.reloadMetadata(ocId: metadata.ocId, ocIdTemp: ocIdTemp) {
                         let indexPath = IndexPath(row: row, section: 0)
                         collectionView?.performBatchUpdates({
@@ -101,6 +104,8 @@ class NCTransfers: NCCollectionViewCommon  {
                         }, completion: { (_) in
                             self.collectionView?.reloadData()
                         })
+                    } else {
+                        reloadDataSource()
                     }
                 }
             }