Bladeren bron

fix

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 jaren geleden
bovenliggende
commit
e2a442b8ba
2 gewijzigde bestanden met toevoegingen van 4 en 25 verwijderingen
  1. 1 1
      README.md
  2. 3 24
      iOSClient/AppDelegate.swift

+ 1 - 1
README.md

@@ -38,7 +38,7 @@ branch. Maybe start working on [starter issues](https://github.com/nextcloud/ios
 
 Easy starting points are also reviewing [pull requests](https://github.com/nextcloud/ios/pulls)
 
-### Xcode 13.4 Project Setup
+### Xcode 14 Project Setup
 
 #### Dependencies
 

+ 3 - 24
iOSClient/AppDelegate.swift

@@ -381,11 +381,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         // Schedule a new task.
         scheduleAppRefresh()
         
-        if account == "" {
+        guard !account.isEmpty else {
             task.setTaskCompleted(success: true)
             return
         }
-
+        
         NKCommon.shared.writeLog("Start handler refresh task [Auto upload]")
 
         NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
@@ -399,7 +399,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         // Schedule a new task.
         scheduleAppProcessing()
         
-        if account == "" {
+        guard !account.isEmpty else {
             task.setTaskCompleted(success: true)
             return
         }
@@ -418,27 +418,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         }
     }
 
-    // MARK: - Fetch
-
-    func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
-
-        if account == "" {
-            completionHandler(UIBackgroundFetchResult.noData)
-            return
-        }
-
-        NKCommon.shared.writeLog("Start perform Fetch [Auto upload]")
-
-        NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
-            NKCommon.shared.writeLog("Completition perform Fetch with \(items) uploads [Auto upload]")
-            if items == 0 {
-                completionHandler(UIBackgroundFetchResult.noData)
-            } else {
-                completionHandler(UIBackgroundFetchResult.newData)
-            }
-        }
-    }
-
     // MARK: - Background Networking Session
 
     func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {