This commit is contained in:
StyleZhang
2024-03-13 16:59:28 +08:00
parent 2edef89a8d
commit e11fc8c131
5 changed files with 24 additions and 5 deletions

View File

@ -86,9 +86,12 @@ export const useWorkflow = () => {
edges,
} = store.getState()
const nodes = getNodes()
const currentNode = nodes.find(node => node.id === nodeId)!
const currentNode = nodes.find(node => node.id === nodeId)
const list: Node[] = []
if (!currentNode)
return list
const traverse = (root: Node, callback: (node: Node) => void) => {
const incomers = getIncomers(root, nodes, edges)