From f866243173020b852277b468fde7298238b467fe Mon Sep 17 00:00:00 2001 From: devleejb Date: Wed, 20 Nov 2024 20:36:07 +0900 Subject: [PATCH] Fix preview updating to render image correctly --- frontend/src/components/editor/Preview.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/editor/Preview.tsx b/frontend/src/components/editor/Preview.tsx index 51ccd315..40fc4400 100644 --- a/frontend/src/components/editor/Preview.tsx +++ b/frontend/src/components/editor/Preview.tsx @@ -58,10 +58,7 @@ const Preview = () => { () => _.throttle( () => { - const editorText = - editorStore.cmView?.state.doc.toString() || - editorStore.doc?.getRoot().content?.toString() || - ""; + const editorText = editorStore.doc?.getRoot().content?.toString() || ""; // Add soft line break setContent(addSoftLineBreak(editorText)); @@ -70,7 +67,7 @@ const Preview = () => { // Set trailing true to prevent ignoring last call { trailing: true } ), - [editorStore.doc, editorStore.cmView] + [editorStore.doc] ); useEffect(() => {