feat: remove redo items in main thread

This commit is contained in:
dscyrescotti
2024-07-17 20:08:45 +07:00
parent ae91b69f88
commit 4807ef1162

View File

@@ -100,7 +100,9 @@ final class History: ObservableObject {
}
}
}
redoStack.removeAll()
DispatchQueue.main.async { [weak self] in
self?.redoStack.removeAll()
}
withPersistence(\.viewContext) { [weak memo] context in
memo?.updatedAt = .now
try context.saveIfNeeded()