浏览代码

call maybeStartIo() without further conditions, remove now unused ApplicationState

B. Petersen 5 年之前
父节点
当前提交
ed46b5d42c
共有 1 个文件被更改,包括 0 次插入16 次删除
  1. 0 16
      deltachat-ios/AppDelegate.swift

+ 0 - 16
deltachat-ios/AppDelegate.swift

@@ -8,13 +8,6 @@ import DBDebugToolkit
 
 
 let logger = SwiftyBeaver.self
 let logger = SwiftyBeaver.self
 
 
-enum ApplicationState {
-    case stopped
-    case running
-    case background
-    case backgroundFetch
-}
-
 @UIApplicationMain
 @UIApplicationMain
 class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {
 class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {
     private let dcContext = DcContext.shared
     private let dcContext = DcContext.shared
@@ -24,7 +17,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     private var backgroundTask: UIBackgroundTaskIdentifier = .invalid
     private var backgroundTask: UIBackgroundTaskIdentifier = .invalid
     var reachability = Reachability()!
     var reachability = Reachability()!
     var window: UIWindow?
     var window: UIWindow?
-    var state = ApplicationState.stopped
     var appIsInForeground = false
     var appIsInForeground = false
 
 
     func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
     func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
@@ -158,7 +150,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     }
     }
 
 
     func closeDatabase() {
     func closeDatabase() {
-        state = .stopped
         dcContext.closeDatabase()
         dcContext.closeDatabase()
     }
     }
 
 
@@ -213,17 +204,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
 
     func startThreads() {
     func startThreads() {
         logger.info("---- start ----")
         logger.info("---- start ----")
-
-        if state == .running {
-            return
-        }
-        state = .running
-
         dcContext.maybeStartIo()
         dcContext.maybeStartIo()
     }
     }
 
 
     func stopThreads() {
     func stopThreads() {
-        state = .background
         dcContext.stopIo()
         dcContext.stopIo()
     }
     }