[Fix][UI] Fix condition task connection failure. (#9548)

ws-common-cnst-protect
Amy0104 2022-04-18 14:09:32 +08:00 committed by GitHub
parent a5bbf7852d
commit 491e9f84ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -114,7 +114,15 @@ export function useCanvasInit(options: Options) {
const sourceData = sourceCell.getData()
if (!sourceData) return true
if (sourceData.taskType !== 'CONDITIONS') return true
return (graph.value?.getConnectedEdges(sourceCell).length || 0) <= 2
const edges = graph.value?.getConnectedEdges(sourceCell)
if (!edges || edges.length < 2) return true
let len = 0
return !edges.some((edge) => {
if (edge.getSourceCellId() === sourceCell.id) {
len++
}
return len > 2
})
}
return true