From cd6f1ca613758ae5d6a4524f05f861a9d1324b71 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Mon, 17 Mar 2025 11:19:05 -0700 Subject: [PATCH] fix: Reduce sync threshold, increase wait time --- src/lib/util/state.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/util/state.ts b/src/lib/util/state.ts index 69adf526..cdb56cb1 100644 --- a/src/lib/util/state.ts +++ b/src/lib/util/state.ts @@ -25,6 +25,7 @@ export const defaultState: State = { mermaid: formatJSON({ theme: 'default' }), + panZoom: true, rough: false, updateDiagram: true }; @@ -170,9 +171,11 @@ export const loadState = (data: string): void => { updateCodeStore(state); }; +let renderCount = 0; export const updateCodeStore = (newState: Partial): void => { inputStateStore.update((state) => { - return { ...state, ...newState }; + renderCount++; + return { ...state, ...newState, renderCount }; }); };