From 5536b057fe59ad2c449a670544b3fe9de7f1ac22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E7=86=B1?= Date: Fri, 21 Jun 2024 21:04:28 +0800 Subject: [PATCH] fix(sheets-drawing): fix crash when editing text after inserting images and opening the sidebar (#2586) --- .../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 && (