From 203b570bebf4c089863d12f1012e04cc5b8d6a3c Mon Sep 17 00:00:00 2001 From: LeeJongBeom <52884648+devleejb@users.noreply.github.com> Date: Wed, 20 Nov 2024 20:44:23 +0900 Subject: [PATCH] Fix intermittent image display issue during image upload (#410) --- 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(() => {