bug: fix stroke glitching

This commit is contained in:
dscyrescotti
2024-05-22 21:37:55 +07:00
parent e1d911f2e1
commit c2b39ba358
5 changed files with 75 additions and 20 deletions
+5
View File
@@ -13,6 +13,11 @@ struct MemolaApp: App {
WindowGroup {
MemosView()
.persistence(\.viewContext)
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willTerminateNotification)) { _ in
withPersistenceSync(\.backgroundContext) { context in
try context.saveIfNeeded()
}
}
}
}
}