Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

KVOJJJind07b2b991568
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 135ee43491a..289e29d5921 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])