mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 17:38:04 +08:00
node value init
This commit is contained in:
@ -16,13 +16,15 @@ export const useNodesInitialData = () => {
|
||||
return useMemo(() => produce(NODES_INITIAL_DATA, (draft) => {
|
||||
Object.keys(draft).forEach((key) => {
|
||||
draft[key as BlockEnum].title = t(`workflow.blocks.${key}`)
|
||||
draft[key as BlockEnum]._isReady = true
|
||||
if (nodesDefaultConfigs[key as BlockEnum]) {
|
||||
draft[key as BlockEnum] = {
|
||||
...draft[key as BlockEnum],
|
||||
...nodesDefaultConfigs[key as BlockEnum],
|
||||
}
|
||||
}
|
||||
else {
|
||||
draft[key as BlockEnum]._isReady = true
|
||||
}
|
||||
})
|
||||
}), [t, nodesDefaultConfigs])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user