瀏覽代碼

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

KVOJJJin 8 月之前
父節點
當前提交
d07b2b9915
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx

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