mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(editor): undefined selected elements (#9429)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user