mirror of https://github.com/langgenius/dify.git
fix node error default value not sync
This commit is contained in:
parent
1120d552b6
commit
2bce046278
|
|
@ -30,8 +30,15 @@ export const useDefaultValue = (
|
|||
const index = default_value.findIndex(form => form.key === key)
|
||||
|
||||
if (index > -1) {
|
||||
const newDefaultValue = [...default_value]
|
||||
newDefaultValue[index].value = value
|
||||
const newDefaultValue = default_value.map((form) => {
|
||||
if (form.key !== key)
|
||||
return form
|
||||
// clone the entry so we do not mutate the original reference (which would block CRDT diffs)
|
||||
return {
|
||||
...form,
|
||||
value,
|
||||
}
|
||||
})
|
||||
handleNodeDataUpdateWithSyncDraft({
|
||||
id,
|
||||
data: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue