fix: workflow connection (#3713)

This commit is contained in:
zxhlyh 2024-04-23 18:02:15 +08:00 committed by GitHub
parent f92130338b
commit 39ae56e136
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -324,18 +324,12 @@ export const useNodesInteractions = () => {
return
}
const needDeleteEdges = edges.filter((edge) => {
if (edge.source === source) {
if (edge.sourceHandle)
return edge.sourceHandle === sourceHandle
else
return true
}
if (edge.target === target) {
if (edge.targetHandle)
return edge.targetHandle === targetHandle
else
return true
}
if (
(edge.source === source && edge.sourceHandle === sourceHandle)
|| (edge.target === target && edge.targetHandle === targetHandle)
)
return true
return false
})
const needDeleteEdgesIds = needDeleteEdges.map(edge => edge.id)