fix: slight code fixup

This commit is contained in:
2025-01-27 00:19:32 +00:00
parent df9492e6e0
commit b6bef39345

View File

@@ -98,6 +98,7 @@ const useRootStore = create<RootStore>()(
const lastStageNodeKey = entry.stages.at(-1) ?? state.starts[0]
if (
lastStageNodeKey === stage ||
// cannot add stage after accepted/rejected
lastStageNodeKey === DEFAULT_NODE.acceptedNode.key ||
lastStageNodeKey === DEFAULT_NODE.rejectedNode.key
) {
@@ -105,12 +106,10 @@ const useRootStore = create<RootStore>()(
}
const lastStageNode = state.nodes[lastStageNodeKey]
const conn = lastStageNode.outs[node.key]
if (conn) {
conn.weight++
} else {
lastStageNode.outs[node.key] = { nodeKey: node.key, weight: 1 }
if (lastStageNode) {
connectNode(lastStageNode, node)
}
entry.stages.push(node.key)
}
}),