Skip to content

Commit 0be0a24

Browse files
committed
Fixes saving last opened note state
1 parent 5d28763 commit 0be0a24

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

FSNotes iOS/AppDelegate.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
7272
}
7373

7474
func applicationWillTerminate(_ application: UIApplication) {
75+
UserDefaultsManagement.crashedLastTime = false
76+
77+
saveEditorState()
78+
7579
let temp = NSTemporaryDirectory()
7680

7781
let encryption = URL(fileURLWithPath: temp).appendingPathComponent("Encryption")
@@ -84,9 +88,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
8488
try? FileManager.default.removeItem(at: imagesPreview)
8589

8690
Storage.shared().saveProjectsCache()
87-
UserDefaultsManagement.crashedLastTime = false
88-
89-
saveEditorState()
9091

9192
print("Termination end, crash status: \(UserDefaultsManagement.crashedLastTime)")
9293
}

0 commit comments

Comments
 (0)