From fb058adb1732f0a5aab3953d5e8fa1c2bd88a7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 4 Sep 2026 12:56:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=8E=E7=A1=AE=E5=88=A0=E9=99=A4=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E8=8A=82=E7=82=B9=E9=80=89=E5=8C=BA=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 仅在存在选中节点时查询删除节点集合 避免使用空字符串作为节点 ID 查询值 --- .../src/view/ui-editor/useUiEditorPage.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts b/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts index 0fa171077..d6f10938a 100644 --- a/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts +++ b/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts @@ -897,7 +897,9 @@ export function useUiEditorSession( setStatus('无法删除该节点。'); return result; } - if (deletedNodeIds?.has(selectedNodeId ?? '')) setSelectedNodeId(null); + if (selectedNodeId != null && deletedNodeIds?.has(selectedNodeId)) { + setSelectedNodeId(null); + } return result; }, [activeImageId, editorDeleteNode, editorUiTrees, selectedNodeId],