diff --git a/Tusker/SceneDelegate.swift b/Tusker/SceneDelegate.swift index b2a172a2..5755676f 100644 --- a/Tusker/SceneDelegate.swift +++ b/Tusker/SceneDelegate.swift @@ -82,6 +82,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + + Preferences.save() + DraftsManager.save() } func sceneDidBecomeActive(_ scene: UIScene) { @@ -92,6 +95,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). + + Preferences.save() + DraftsManager.save() } func sceneWillEnterForeground(_ scene: UIScene) { @@ -103,9 +109,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. - - Preferences.save() - DraftsManager.save() } func activateAccount(_ account: LocalData.UserAccountInfo) {