From 3acfb0fb6ed2bb9f53b4303ed3aeb90004d18f02 Mon Sep 17 00:00:00 2001 From: Joey Ballentine <34788790+joeyballentine@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:25:04 -0400 Subject: [PATCH] Unselect nodes for undo history (#2961) --- src/renderer/components/HistoryProvider.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/HistoryProvider.tsx b/src/renderer/components/HistoryProvider.tsx index cc33874dd..37c4ddd0f 100644 --- a/src/renderer/components/HistoryProvider.tsx +++ b/src/renderer/components/HistoryProvider.tsx @@ -102,7 +102,10 @@ export const HistoryProvider = memo( if (selfUpdate) return noop; const id = setTimeout(() => { - historyRef.current = historyRef.current.commit([getNodes(), getEdges()]); + historyRef.current = historyRef.current.commit([ + getNodes().map((n) => ({ ...n, selected: false })), + getEdges(), + ]); }, 250); return () => clearTimeout(id); // eslint-disable-next-line react-hooks/exhaustive-deps