Explorar el Código

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

Yi Xiao hace 4 meses
padre
commit
20c4633d2a

+ 2 - 1
web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx

@@ -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,