Эх сурвалжийг харах

Merge pull request #1866 from nextcloud/fix/share-upload

fix share
Marino Faggiana 3 жил өмнө
parent
commit
c2561eaacc

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -3051,7 +3051,7 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 4;
 				DEFINES_MODULE = YES;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -3117,7 +3117,7 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 4;
 				DEFINES_MODULE = YES;
 				ENABLE_NS_ASSERTIONS = NO;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;

+ 5 - 10
Share/NCShareExtension.swift

@@ -177,9 +177,11 @@ class NCShareExtension: UIViewController {
         tableView.reloadData()
     }
 
-    override func viewWillDisappear(_ animated: Bool) {
-        super.viewWillDisappear(animated)
-        // remove all metadata in queue
+    // MARK: -
+
+    func cancel(with error: NCShareExtensionError) {
+        // make sure no uploads are continued
+        uploadStarted = false
         for metadata in uploadMetadata {
             let filePath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
             let path = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId)!
@@ -187,13 +189,6 @@ class NCShareExtension: UIViewController {
             NCNetworking.shared.uploadRequest[filePath]?.tasks.forEach({ $0.cancel() })
             NCUtilityFileSystem.shared.deleteFile(filePath: path)
         }
-    }
-
-    // MARK: -
-
-    func cancel(with error: NCShareExtensionError) {
-        // make sure no uploads are continued
-        uploadStarted = false
         extensionContext?.cancelRequest(withError: error)
     }