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

This commit is contained in:
Yifeng Wang authored and GitHub committed 2024-12-30 17:25:07 +08:00
1 parent b66a64bc9a
commit 08ebfb6e70
1 file changed
+2 -2
@@ -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;