|
|
@@ -74,6 +74,9 @@ class CoreDataStack: ObservableObject {
|
|
|
// Create a private queue context
|
|
|
/// - Tag: newBackgroundContext
|
|
|
let taskContext = persistentContainer.newBackgroundContext()
|
|
|
+
|
|
|
+ /// ensure that the background contexts stay in sync with the main context
|
|
|
+ taskContext.automaticallyMergesChangesFromParent = true
|
|
|
taskContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
|
|
|
taskContext.undoManager = nil
|
|
|
return taskContext
|