@ -174,7 +174,12 @@ const useOneStepRun = <T>({
} = useInspectVarsCrud ( )
} = useInspectVarsCrud ( )
const runningStatus = data . _singleRunningStatus || NodeRunningStatus . NotStart
const runningStatus = data . _singleRunningStatus || NodeRunningStatus . NotStart
const isPaused = ! data . _isSingleRun
const setRunResult = useCallback ( async ( data : NodeRunResult | null ) = > {
const setRunResult = useCallback ( async ( data : NodeRunResult | null ) = > {
// The backend don't support pause the single run, so the frontend handle the pause state.
if ( isPaused )
return
const canRunLastRun = ! isRunAfterSingleRun || runningStatus === NodeRunningStatus . Succeeded
const canRunLastRun = ! isRunAfterSingleRun || runningStatus === NodeRunningStatus . Succeeded
if ( ! canRunLastRun ) {
if ( ! canRunLastRun ) {
doSetRunResult ( data )
doSetRunResult ( data )
@ -192,7 +197,7 @@ const useOneStepRun = <T>({
invalidateSysVarValues ( )
invalidateSysVarValues ( )
invalidateConversationVarValues ( ) // loop, iteration, variable assigner node can update the conversation variables, but to simple the logic(some nodes may also can update in the future), all nodes refresh.
invalidateConversationVarValues ( ) // loop, iteration, variable assigner node can update the conversation variables, but to simple the logic(some nodes may also can update in the future), all nodes refresh.
}
}
} , [ is RunAfterSingleRun, runningStatus , appId , id , store , appendNodeInspectVars , invalidLastRun , isStartNode , invalidateSysVarValues , invalidateConversationVarValues ] )
} , [ is Paused, is RunAfterSingleRun, runningStatus , appId , id , store , appendNodeInspectVars , invalidLastRun , isStartNode , invalidateSysVarValues , invalidateConversationVarValues ] )
const { handleNodeDataUpdate } : { handleNodeDataUpdate : ( data : any ) = > void } = useNodeDataUpdate ( )
const { handleNodeDataUpdate } : { handleNodeDataUpdate : ( data : any ) = > void } = useNodeDataUpdate ( )
const [ canShowSingleRun , setCanShowSingleRun ] = useState ( false )
const [ canShowSingleRun , setCanShowSingleRun ] = useState ( false )