Skip to content

Commit

Permalink
Fix intermittent image display issue during image upload (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
devleejb authored and minai621 committed Nov 26, 2024
1 parent 7a54f6a commit 8f5a7f5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions frontend/src/components/editor/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -70,7 +67,7 @@ const Preview = () => {
// Set trailing true to prevent ignoring last call
{ trailing: true }
),
[editorStore.doc, editorStore.cmView]
[editorStore.doc]
);

useEffect(() => {
Expand Down

0 comments on commit 8f5a7f5

Please sign in to comment.