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

This commit is contained in:
Yi Xiao
2024-12-05 13:59:59 +08:00
committed by GitHub
parent 5669cac16d
commit 20c4633d2a

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,