|
@@ -119,7 +119,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
dcContext.maybeStartIo()
|
|
dcContext.maybeStartIo()
|
|
dcContext.maybeNetwork()
|
|
dcContext.maybeNetwork()
|
|
|
|
|
|
- DispatchQueue.main.asyncAfter(deadline: .now() + 10) {
|
|
|
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 10) { [weak self] in
|
|
|
|
+ guard let self = self else {
|
|
|
|
+ completionHandler(.failed)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
if !self.appIsInForeground {
|
|
if !self.appIsInForeground {
|
|
self.dcContext.stopIo()
|
|
self.dcContext.stopIo()
|
|
}
|
|
}
|
|
@@ -386,7 +391,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
dcContext.maybeStartIo()
|
|
dcContext.maybeStartIo()
|
|
dcContext.maybeNetwork()
|
|
dcContext.maybeNetwork()
|
|
|
|
|
|
- DispatchQueue.main.asyncAfter(deadline: .now() + 10) {
|
|
|
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 10) { [weak self] in
|
|
|
|
+ guard let self = self else {
|
|
|
|
+ completionHandler(.failed)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
if !self.appIsInForeground {
|
|
if !self.appIsInForeground {
|
|
self.dcContext.stopIo()
|
|
self.dcContext.stopIo()
|
|
}
|
|
}
|