fix: empty object (conversation variable) editable (#11352)

This commit is contained in:
Yi Xiao 2024-12-05 13:59:59 +08:00 committed by Joel
parent 824877dd5f
commit ed234e82d0
1 changed files with 2 additions and 1 deletions

View File

@ -97,8 +97,9 @@ const ChatVariableModal = ({
return objectPlaceholder
}, [type])
const getObjectValue = useCallback(() => {
if (!chatVar)
if (!chatVar || Object.keys(chatVar.value).length === 0)
return [DEFAULT_OBJECT_VALUE]
return Object.keys(chatVar.value).map((key) => {
return {
key,