fix(core): remove edge lookup update when updating connection lookup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(changeset): add

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

---------

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2025-03-17 12:47:52 +01:00
parent b85b0ec66f
commit 05e4df2cb6
3 changed files with 13 additions and 5 deletions
+8 -2
View File
@@ -509,7 +509,13 @@ export function useActions(state: State, nodeLookup: ComputedRef<NodeLookup>, ed
}
const updateEdge: Actions['updateEdge'] = (oldEdge, newConnection, shouldReplaceId = true) => {
const prevEdge = findEdge(oldEdge.id)!
const prevEdge = findEdge(oldEdge.id)
if (!prevEdge) {
return false
}
const prevEdgeIndex = state.edges.indexOf(prevEdge)
const newEdge = updateEdgeAction(oldEdge, newConnection, prevEdge, shouldReplaceId, state.hooks.error.trigger)
@@ -525,7 +531,7 @@ export function useActions(state: State, nodeLookup: ComputedRef<NodeLookup>, ed
state.edges,
)
state.edges.splice(state.edges.indexOf(prevEdge), 1, validEdge)
state.edges = state.edges.map((edge, index) => (index === prevEdgeIndex ? validEdge : edge))
updateConnectionLookup(state.connectionLookup, edgeLookup.value, [validEdge])