marinofaggiana 4 years ago
parent
commit
ca0d336f76

+ 1 - 1
Nextcloud.xcodeproj/project.pbxproj

@@ -2835,7 +2835,7 @@
 			repositoryURL = "https://github.com/realm/realm-cocoa";
 			requirement = {
 				kind = exactVersion;
-				version = 10.7.2;
+				version = 10.7.3;
 			};
 		};
 		F786D58B253454BF00E3DD7B /* XCRemoteSwiftPackageReference "ios-communication-library" */ = {

+ 7 - 3
Share/NCShareExtension.swift

@@ -152,6 +152,10 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
         }
     }
     
+    override func viewDidDisappear(_ animated: Bool) {
+        
+    }
+    
     override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
         super.viewWillTransition(to: size, with: coordinator)
         
@@ -163,8 +167,8 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
     override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
         super.traitCollectionDidChange(previousTraitCollection)
         
-        collectionView.reloadData()
-        tableView.reloadData()
+//        collectionView.reloadData()
+//        tableView.reloadData()
     }
     
     // MARK: -
@@ -319,7 +323,7 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
         if let fileName = filesName.first {
             
             filesName.removeFirst()
-            let ocId = NSUUID().uuidString
+            let ocId = "extension"+NSUUID().uuidString
             let filePath = CCUtility.getDirectoryProviderStorageOcId(ocId, fileNameView: fileName)!
                 
             if NCUtilityFileSystem.shared.moveFile(atPath: (NSTemporaryDirectory() + fileName), toPath: filePath) {

+ 8 - 2
iOSClient/Networking/NCNetworkingChunkedUpload.swift

@@ -63,8 +63,6 @@ extension NCNetworking {
                 
         createChunkedFolder(chunkFolderPath: chunkFolderPath, account: metadata.account) { (errorCode, errorDescription) in
             
-            completion(errorCode, errorDescription)
-
             if errorCode == 0 {
                     
                 NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadStartFile, userInfo: ["ocId": metadata.ocId])
@@ -157,23 +155,31 @@ extension NCNetworking {
                                         
                                         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSourceNetworkForced, userInfo: ["serverUrl": serverUrl])
                                     }
+                                    
+                                    completion(errorCode, errorDescription)
                                 }
                                 
                             } else {
                                 
                                 self.uploadChunkFileError(metadata: metadata, chunkFolderPath: chunkFolderPath, directoryProviderStorageOcId: directoryProviderStorageOcId, errorCode: errorCode, errorDescription: errorDescription)
+                                
+                                completion(errorCode, errorDescription)
                             }
                         }
                                                         
                     } else {
                                                             
                         self.uploadChunkFileError(metadata: metadata, chunkFolderPath: chunkFolderPath, directoryProviderStorageOcId: directoryProviderStorageOcId, errorCode: uploadErrorCode, errorDescription: uploadErrorDescription)
+                        
+                        completion(errorCode, errorDescription)
                     }
                 }
                 
             } else {
                 
                 self.uploadChunkFileError(metadata: metadata, chunkFolderPath: chunkFolderPath, directoryProviderStorageOcId: directoryProviderStorageOcId, errorCode: errorCode, errorDescription: errorDescription)
+                
+                completion(errorCode, errorDescription)
             }
         }
     }