From 4807ef116278a6b7825e25d5b381985b59553a85 Mon Sep 17 00:00:00 2001 From: dscyrescotti Date: Wed, 17 Jul 2024 20:08:45 +0700 Subject: [PATCH] feat: remove redo items in main thread --- Memola/Canvas/History/History.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Memola/Canvas/History/History.swift b/Memola/Canvas/History/History.swift index 9cbf6c8..83dc934 100644 --- a/Memola/Canvas/History/History.swift +++ b/Memola/Canvas/History/History.swift @@ -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()