fix: slight code fixup
This commit is contained in:
@@ -98,6 +98,7 @@ const useRootStore = create<RootStore>()(
|
|||||||
const lastStageNodeKey = entry.stages.at(-1) ?? state.starts[0]
|
const lastStageNodeKey = entry.stages.at(-1) ?? state.starts[0]
|
||||||
if (
|
if (
|
||||||
lastStageNodeKey === stage ||
|
lastStageNodeKey === stage ||
|
||||||
|
// cannot add stage after accepted/rejected
|
||||||
lastStageNodeKey === DEFAULT_NODE.acceptedNode.key ||
|
lastStageNodeKey === DEFAULT_NODE.acceptedNode.key ||
|
||||||
lastStageNodeKey === DEFAULT_NODE.rejectedNode.key
|
lastStageNodeKey === DEFAULT_NODE.rejectedNode.key
|
||||||
) {
|
) {
|
||||||
@@ -105,12 +106,10 @@ const useRootStore = create<RootStore>()(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const lastStageNode = state.nodes[lastStageNodeKey]
|
const lastStageNode = state.nodes[lastStageNodeKey]
|
||||||
const conn = lastStageNode.outs[node.key]
|
if (lastStageNode) {
|
||||||
if (conn) {
|
connectNode(lastStageNode, node)
|
||||||
conn.weight++
|
|
||||||
} else {
|
|
||||||
lastStageNode.outs[node.key] = { nodeKey: node.key, weight: 1 }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
entry.stages.push(node.key)
|
entry.stages.push(node.key)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
Reference in New Issue
Block a user