Fix: missing default value of type array object in conversation variable modal (#7309)

This commit is contained in:
KVOJJJin 2024-08-15 17:28:12 +08:00 committed by GitHub
parent 04131f86df
commit d07b2b9915
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -236,8 +236,14 @@ const ChatVariableModal = ({
setType(chatVar.value_type)
setValue(chatVar.value)
setDes(chatVar.description)
setEditInJSON(false)
setObjectValue(getObjectValue())
if (chatVar.value_type === ChatVarType.ArrayObject) {
setEditorContent(JSON.stringify(chatVar.value))
setEditInJSON(true)
}
else {
setEditInJSON(false)
}
}
}, [chatVar, getObjectValue])