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] 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)
} }
}), }),