Browse Source

fix

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
63fd1a43d9
1 changed files with 2 additions and 5 deletions
  1. 2 5
      iOSClient/AppDelegate.swift

+ 2 - 5
iOSClient/AppDelegate.swift

@@ -151,11 +151,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         NotificationCenter.default.addObserver(self, selector: #selector(initialize), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterInitialize), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(initialize), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterInitialize), object: nil)
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitialize, userInfo:["atStart":1])
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitialize, userInfo:["atStart":1])
 
 
-        // Process upload
-        if UIApplication.shared.applicationState != .background {
-            networkingProcessUpload = NCNetworkingProcessUpload()
-        }
-
         // Push Notification & display notification
         // Push Notification & display notification
         application.registerForRemoteNotifications()
         application.registerForRemoteNotifications()
         UNUserNotificationCenter.current().delegate = self
         UNUserNotificationCenter.current().delegate = self
@@ -218,6 +213,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
 
         if account == "" { return }
         if account == "" { return }
 
 
+        // Process upload
+        networkingProcessUpload = NCNetworkingProcessUpload()
         networkingProcessUpload?.verifyUploadZombie()
         networkingProcessUpload?.verifyUploadZombie()
 
 
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterApplicationDidBecomeActive)
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterApplicationDidBecomeActive)