feat: update updated date of memo when if there are changes

This commit is contained in:
dscyrescotti
2024-06-27 16:47:13 +07:00
parent deada8b48c
commit 89c5a62612
9 changed files with 58 additions and 15 deletions

View File

@@ -14,6 +14,9 @@ struct MemolaApp: App {
MemosView()
.persistence(\.viewContext)
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willTerminateNotification)) { _ in
withPersistenceSync(\.viewContext) { context in
try context.saveIfNeeded()
}
withPersistenceSync(\.backgroundContext) { context in
try context.saveIfNeeded()
}