Skip to content

Commit

Permalink
fix(sheets-drawing): fix crash when editing text after inserting imag…
Browse files Browse the repository at this point in the history
…es and opening the sidebar (#2586)
  • Loading branch information
jikkai authored Jun 21, 2024
1 parent 61de312 commit 5536b05
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 SheetDrawingPanel = () => {
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 SheetDrawingPanel = () => {
};
}, []);

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

0 comments on commit 5536b05

Please sign in to comment.