feat(ui): adding node selects new node exclusively

This commit is contained in:
psychedelicious 2023-08-19 17:46:35 +10:00
parent 4be4fc6731
commit 4ac41bc4b1

View File

@ -144,6 +144,18 @@ const nodesSlice = createSlice({
node.position.y
);
node.position = position;
node.selected = true;
state.nodes = applyNodeChanges(
state.nodes.map((n) => ({ id: n.id, type: 'select', selected: false })),
state.nodes
);
state.edges = applyEdgeChanges(
state.edges.map((e) => ({ id: e.id, type: 'select', selected: false })),
state.edges
);
state.nodes.push(node);
if (!isInvocationNode(node)) {