fix(editor): undefined selected elements (#9429)

This commit is contained in:
Yifeng Wang
2024-12-30 17:25:07 +08:00
committed by GitHub
parent b66a64bc9a
commit 08ebfb6e70

View File

@@ -280,8 +280,8 @@ export function getCopilotSelectedElems(
const copilotWidget = getEdgelessCopilotWidget(host);
if (copilotWidget.visible) {
return (service.gfx.tool.currentTool$.peek() as CopilotTool)
.selectedElements;
const currentTool = service.gfx.tool.currentTool$.peek() as CopilotTool;
return currentTool?.selectedElements ?? [];
}
return service.selection.selectedElements;