Browse Source

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

KVOJJJin 8 tháng trước cách đây
mục cha
commit
d07b2b9915

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

@@ -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])