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:
authorMarino Faggiana <marino@marinofaggiana.com>2022-11-04 19:25:39 +0300
committerMarino Faggiana <marino@marinofaggiana.com>2022-11-04 19:25:39 +0300
commit49f27482112c4c6daab84b198218163790d0577a (patch)
tree4973fcf133ae9ce9041a7be016511e8c8d1b77a2
parentf8faad1cf7fbcd3436c40886d17de323ac725fe1 (diff)
added observeTableMetadata
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
-rw-r--r--iOSClient/Networking/NCNetworkingProcessUpload.swift5
1 files changed, 4 insertions, 1 deletions
diff --git a/iOSClient/Networking/NCNetworkingProcessUpload.swift b/iOSClient/Networking/NCNetworkingProcessUpload.swift
index 1e4e0564a..5bb90af64 100644
--- a/iOSClient/Networking/NCNetworkingProcessUpload.swift
+++ b/iOSClient/Networking/NCNetworkingProcessUpload.swift
@@ -36,6 +36,7 @@ class NCNetworkingProcessUpload: NSObject {
private let appDelegate = UIApplication.shared.delegate as! AppDelegate
private var notificationToken: NotificationToken?
private var timerProcess: Timer?
+ private var pauseProcess: Bool = false
func observeTableMetadata() {
let realm = try! Realm()
@@ -85,7 +86,7 @@ class NCNetworkingProcessUpload: NSObject {
func start(completition: @escaping (_ items: Int) -> Void) {
- if appDelegate.account.isEmpty { return completition(0) }
+ if appDelegate.account.isEmpty || pauseProcess { return completition(0) }
let applicationState = UIApplication.shared.applicationState
let queue = DispatchQueue.global()
@@ -192,11 +193,13 @@ class NCNetworkingProcessUpload: NSObject {
if localIdentifiers.isEmpty { return }
let assets = PHAsset.fetchAssets(withLocalIdentifiers: localIdentifiers, options: nil)
+ self.pauseProcess = true
PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.deleteAssets(assets as NSFastEnumeration)
}, completionHandler: { _, _ in
NCManageDatabase.shared.clearAssetLocalIdentifiers(localIdentifiers, account: self.appDelegate.account)
+ self.pauseProcess = false
})
}