From d07b2b991568f461170ec06e7cb063c5d1d39a23 Mon Sep 17 00:00:00 2001 From: KVOJJJin Date: Thu, 15 Aug 2024 17:28:12 +0800 Subject: [PATCH] Fix: missing default value of type array object in conversation variable modal (#7309) --- .../chat-variable-panel/components/variable-modal.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx index 135ee43491..289e29d592 100644 --- a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx +++ b/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])