fix(web): if-else node case show

This commit is contained in:
zhaoying
2026-04-09 17:45:42 +08:00
parent 9f9ac69f97
commit 33a1c178ff
2 changed files with 13 additions and 3 deletions

View File

@@ -106,6 +106,16 @@ export const useWorkflowGraph = ({
const [chatVariables, setChatVariables] = useState<ChatVariable[]>([])
const featuresRef = useRef<FeaturesConfigForm | undefined>(undefined)
useEffect(() => {
if (!graphRef.current) return
graphRef.current.getNodes().forEach(node => {
const data = node.getData()
if (data?.type === 'if-else' || data?.type === 'question-classifier') {
node.setData({ ...data, chatVariables }, { silent: true })
}
})
}, [chatVariables])
useEffect(() => {
getConfig()
}, [id])
@@ -211,7 +221,7 @@ export const useWorkflowGraph = ({
id,
type,
name,
data: { ...node, ...nodeLibraryConfig},
data: { ...node, ...nodeLibraryConfig, ...((type === 'if-else' || type === 'question-classifier') ? { chatVariables } : {}) },
...position,
}