diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/code-editor.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/code-editor.tsx index d076f05f0a..a3c2552b45 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/code-editor.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/code-editor.tsx @@ -70,7 +70,7 @@ const CodeEditor: FC = ({ }, []) const handleEditorChange = useCallback((value: string | undefined) => { - if (value) + if (value !== undefined) onUpdate?.(value) }, [onUpdate]) diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx index aaaff2b911..148d65346c 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx @@ -128,9 +128,9 @@ const JsonSchemaConfig: FC = ({ advancedEditing && setAdvancedEditing(false) isAddingNewField && setIsAddingNewField(false) } - setJsonSchema(defaultSchema || DEFAULT_SCHEMA) - setJson(JSON.stringify(defaultSchema || DEFAULT_SCHEMA, null, 2)) - }, [currentTab, defaultSchema, advancedEditing, isAddingNewField, setAdvancedEditing, setIsAddingNewField, setHoveringProperty]) + setJsonSchema(DEFAULT_SCHEMA) + setJson(JSON.stringify(DEFAULT_SCHEMA, null, 2)) + }, [currentTab, advancedEditing, isAddingNewField, setAdvancedEditing, setIsAddingNewField, setHoveringProperty]) const handleCancel = useCallback(() => { onClose()