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: empty object (conversation variable) editable (#11352)

Yi Xiao20c4633d2a9a
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 2118894cc7d..baa42eef24f 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
@@ -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,