Parcourir la source

fix auto upload

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana il y a 2 ans
Parent
commit
05af699d66
2 fichiers modifiés avec 8 ajouts et 15 suppressions
  1. 2 2
      Nextcloud.xcodeproj/project.pbxproj
  2. 6 13
      iOSClient/AppDelegate.swift

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -3607,7 +3607,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -3670,7 +3670,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;

+ 6 - 13
iOSClient/AppDelegate.swift

@@ -203,6 +203,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
             networkingProcessUpload?.verifyUploadZombie()
         }
 
+        // Start Auto Upload
+        NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
+            NKCommon.shared.writeLog("[INFO] Initialize Auto upload with \(items) uploads")
+            DispatchQueue.main.async { self.networkingProcessUpload = NCNetworkingProcessUpload() }
+        }
+
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterApplicationDidBecomeActive)
     }
 
@@ -215,13 +221,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         // Account changed ??
         if activeAccount.account != account {
             settingAccount(activeAccount.account, urlBase: activeAccount.urlBase, user: activeAccount.user, userId: activeAccount.userId, password: CCUtility.getPassword(activeAccount.account))
-        } else {
-            // Initialize Auto upload
-            NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
-                NKCommon.shared.writeLog("[INFO] Initialize Auto upload with \(items) uploads")
-                // START UPLOAD PROCESS
-                DispatchQueue.main.async { self.networkingProcessUpload = NCNetworkingProcessUpload() }
-            }
         }
 
         // Required unsubscribing / subscribing
@@ -309,12 +308,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         // Registeration push notification
         NCPushNotification.shared().pushNotification()
 
-        // Start Auto Upload
-        NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
-            NKCommon.shared.writeLog("[INFO] Initialize Auto upload with \(items) uploads")
-            DispatchQueue.main.async { self.networkingProcessUpload = NCNetworkingProcessUpload() }
-        }
-
         // Start services
         NCService.shared.startRequestServicesServer()