mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-18 03:35:57 +08:00
feat: after run start node fetch sys vars
This commit is contained in:
parent
3c0f1d2c74
commit
3ec6f96722
@ -228,6 +228,7 @@ const useInspectVarsCrud = () => {
|
|||||||
deleteAllInspectorVars,
|
deleteAllInspectorVars,
|
||||||
isInspectVarEdited,
|
isInspectVarEdited,
|
||||||
resetToLastRunVar,
|
resetToLastRunVar,
|
||||||
|
invalidateSysVarValues,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,6 +116,7 @@ const useOneStepRun = <T>({
|
|||||||
const isChatMode = useIsChatMode()
|
const isChatMode = useIsChatMode()
|
||||||
const isIteration = data.type === BlockEnum.Iteration
|
const isIteration = data.type === BlockEnum.Iteration
|
||||||
const isLoop = data.type === BlockEnum.Loop
|
const isLoop = data.type === BlockEnum.Loop
|
||||||
|
const isStartNode = data.type === BlockEnum.Start
|
||||||
|
|
||||||
const availableNodes = getBeforeNodesInSameBranch(id)
|
const availableNodes = getBeforeNodesInSameBranch(id)
|
||||||
const availableNodesIncludeParent = getBeforeNodesInSameBranchIncludeParent(id)
|
const availableNodesIncludeParent = getBeforeNodesInSameBranchIncludeParent(id)
|
||||||
@ -166,6 +167,7 @@ const useOneStepRun = <T>({
|
|||||||
const [runResult, doSetRunResult] = useState<NodeRunResult | null>(null)
|
const [runResult, doSetRunResult] = useState<NodeRunResult | null>(null)
|
||||||
const {
|
const {
|
||||||
appendNodeInspectVars,
|
appendNodeInspectVars,
|
||||||
|
invalidateSysVarValues,
|
||||||
} = useInspectVarsCrud()
|
} = useInspectVarsCrud()
|
||||||
const setRunResult = useCallback(async (data: NodeRunResult | null) => {
|
const setRunResult = useCallback(async (data: NodeRunResult | null) => {
|
||||||
doSetRunResult(data)
|
doSetRunResult(data)
|
||||||
@ -175,8 +177,10 @@ const useOneStepRun = <T>({
|
|||||||
const { getNodes } = store.getState()
|
const { getNodes } = store.getState()
|
||||||
const nodes = getNodes()
|
const nodes = getNodes()
|
||||||
appendNodeInspectVars(id, vars, nodes)
|
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 { handleNodeDataUpdate }: { handleNodeDataUpdate: (data: any) => void } = useNodeDataUpdate()
|
||||||
const [canShowSingleRun, setCanShowSingleRun] = useState(false)
|
const [canShowSingleRun, setCanShowSingleRun] = useState(false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user