Skip to content

Commit

Permalink
fix(core): correct connection keys (#1749)
Browse files Browse the repository at this point in the history
* fix(core): correct connection keys

Signed-off-by: braks <[email protected]>

* chore(changeset): add

Signed-off-by: braks <[email protected]>

---------

Signed-off-by: braks <[email protected]>
  • Loading branch information
bcakmakoglu committed Jan 16, 2025
1 parent e94611a commit 424f6cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-buttons-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-flow/core": patch
---

Correct connection keys.
4 changes: 2 additions & 2 deletions packages/core/src/utils/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ export function updateConnectionLookup(connectionLookup: ConnectionLookup, edgeL
const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge

const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle }
const sourceKey = `${sourceNode}-${sourceHandle}`
const targetKey = `${targetNode}-${targetHandle}`
const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`
const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`

addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle)
addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle)
Expand Down

0 comments on commit 424f6cf

Please sign in to comment.