Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'iOSClient/Networking/NCAutoUpload.swift')
-rw-r--r--iOSClient/Networking/NCAutoUpload.swift7
1 files changed, 6 insertions, 1 deletions
diff --git a/iOSClient/Networking/NCAutoUpload.swift b/iOSClient/Networking/NCAutoUpload.swift
index 8f430aafe..22eef062f 100644
--- a/iOSClient/Networking/NCAutoUpload.swift
+++ b/iOSClient/Networking/NCAutoUpload.swift
@@ -34,7 +34,7 @@ class NCAutoUpload: NSObject {
private var endForAssetToUpload: Bool = false
private let appDelegate = UIApplication.shared.delegate as? AppDelegate
- private let applicationState = UIApplication.shared.applicationState
+ private var applicationState = UIApplication.shared.applicationState
// MARK: -
@@ -43,6 +43,7 @@ class NCAutoUpload: NSObject {
completion(0)
return
}
+ applicationState = UIApplication.shared.applicationState
NCAskAuthorization.shared.askAuthorizationPhotoLibrary(viewController: viewController) { hasPermission in
guard hasPermission else {
@@ -60,6 +61,8 @@ class NCAutoUpload: NSObject {
@objc func autoUploadFullPhotos(viewController: UIViewController?, log: String) {
+ applicationState = UIApplication.shared.applicationState
+
NCAskAuthorization.shared.askAuthorizationPhotoLibrary(viewController: viewController) { hasPermission in
guard hasPermission else { return }
let error = NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: "_create_full_upload_")
@@ -169,8 +172,10 @@ class NCAutoUpload: NSObject {
self.endForAssetToUpload = true
if selector == NCGlobal.shared.selectorUploadAutoUploadAll || self.applicationState == .active {
+ NKCommon.shared.writeLog("[INFO] Start createProcessUploads")
self.appDelegate?.networkingProcessUpload?.createProcessUploads(metadatas: metadatas, completion: completion)
} else {
+ NKCommon.shared.writeLog("[INFO] Start createUploadProcessAutoUploadInBackground")
var metadatasForUpload: [tableMetadata] = []
for metadata in metadatas {
if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ && serverUrl == %@ && fileName == %@ && session != ''", metadata.account, metadata.serverUrl, metadata.fileName)) != nil { continue }