Browse Source

Merge pull request #786 from deltachat/revert-784-maybe-network-on-fg

Revert "call maybeNetwork() unconditionally on coming to foreground; "
cyBerta 5 years ago
parent
commit
564d63d315
1 changed files with 3 additions and 1 deletions
  1. 3 1
      deltachat-ios/AppDelegate.swift

+ 3 - 1
deltachat-ios/AppDelegate.swift

@@ -103,7 +103,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         logger.info("---- foreground ----")
         appIsInForeground = true
         startThreads()
-        self.dcContext.maybeNetwork()
+        if reachability.connection != .none {
+            self.dcContext.maybeNetwork()
+        }
 
         if let userDefaults = UserDefaults.shared, userDefaults.bool(forKey: UserDefaults.hasExtensionAttemptedToSend) {
             userDefaults.removeObject(forKey: UserDefaults.hasExtensionAttemptedToSend)