From fdadec01c3edcb15b20a4ab502a2581f58a4e7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E7=86=B1?= Date: Fri, 21 Jun 2024 20:56:17 +0800 Subject: [PATCH] fix(sheets-drawing): fix crash when editing text after inserting images and opening the sidebar --- .../src/views/sheet-image-panel/SheetDrawingPanel.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingPanel.tsx b/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingPanel.tsx index 0d3852d9702..b5ccce28224 100644 --- a/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingPanel.tsx +++ b/packages/sheets-drawing-ui/src/views/sheet-image-panel/SheetDrawingPanel.tsx @@ -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(focusDrawings); useEffect(() => { @@ -42,7 +38,7 @@ export const SheetDrawingPanel = () => { }; }, []); - return ( + return !!drawings?.length && (