From d7d0aff6720a48df5c859d02dd7cafd473c37b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E7=86=B1?= Date: Wed, 19 Jun 2024 11:17:26 +0800 Subject: [PATCH] fix(docs-drawing): fix crash when editing text after inserting images and opening the sidebar --- .../src/views/doc-image-panel/DocDrawingPanel.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPanel.tsx b/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPanel.tsx index def4eed9fa5..4fd8ad2605b 100644 --- a/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPanel.tsx +++ b/packages/docs-drawing-ui/src/views/doc-image-panel/DocDrawingPanel.tsx @@ -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(focusDrawings); useEffect(() => { @@ -42,7 +38,7 @@ export const DocDrawingPanel = () => { }; }, []); - return ( + return !!drawings?.length && (