fix(web): if-else node case show
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user