feat: after run start node fetch sys vars

This commit is contained in:
Joel 2025-05-23 10:18:27 +08:00
parent 3c0f1d2c74
commit 3ec6f96722
2 changed files with 6 additions and 1 deletions

View File

@ -228,6 +228,7 @@ const useInspectVarsCrud = () => {
deleteAllInspectorVars,
isInspectVarEdited,
resetToLastRunVar,
invalidateSysVarValues,
}
}

View File

@ -116,6 +116,7 @@ const useOneStepRun = <T>({
const isChatMode = useIsChatMode()
const isIteration = data.type === BlockEnum.Iteration
const isLoop = data.type === BlockEnum.Loop
const isStartNode = data.type === BlockEnum.Start
const availableNodes = getBeforeNodesInSameBranch(id)
const availableNodesIncludeParent = getBeforeNodesInSameBranchIncludeParent(id)
@ -166,6 +167,7 @@ const useOneStepRun = <T>({
const [runResult, doSetRunResult] = useState<NodeRunResult | null>(null)
const {
appendNodeInspectVars,
invalidateSysVarValues,
} = useInspectVarsCrud()
const setRunResult = useCallback(async (data: NodeRunResult | null) => {
doSetRunResult(data)
@ -175,8 +177,10 @@ const useOneStepRun = <T>({
const { getNodes } = store.getState()
const nodes = getNodes()
appendNodeInspectVars(id, vars, nodes)
if(isStartNode)
invalidateSysVarValues()
}
}, [invalidLastRun, appId, store, appendNodeInspectVars, id])
}, [invalidLastRun, appId, id, store, appendNodeInspectVars, isStartNode, invalidateSysVarValues])
const { handleNodeDataUpdate }: { handleNodeDataUpdate: (data: any) => void } = useNodeDataUpdate()
const [canShowSingleRun, setCanShowSingleRun] = useState(false)