Skip to content

Commit

Permalink
fix(docs-drawing): fix crash when editing text after inserting images…
Browse files Browse the repository at this point in the history
… and opening the sidebar (#2548)
  • Loading branch information
jikkai committed Jun 19, 2024
1 parent 4f8eae1 commit f59ab40
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ export const DocDrawingPanel = () => {
const drawingManagerService = useDependency(IDrawingManagerService);
const focusDrawings = drawingManagerService.getFocusDrawings();

if (focusDrawings == null || focusDrawings.length === 0) {
return;
}

const [drawings, setDrawings] = useState<IDrawingParam[]>(focusDrawings);

useEffect(() => {
Expand All @@ -42,7 +38,7 @@ export const DocDrawingPanel = () => {
};
}, []);

return (
return !!drawings?.length && (
<div className={styles.imageCommonPanel}>
<DrawingCommonPanel drawings={drawings} />
<DocDrawingAnchor drawings={drawings} />
Expand Down

0 comments on commit f59ab40

Please sign in to comment.