From dfad42075ca8451c206139a8aa2d7cbb662edd5a Mon Sep 17 00:00:00 2001 From: StyleZhang Date: Mon, 1 Apr 2024 11:45:20 +0800 Subject: [PATCH] sys variable --- .../prompt-editor/plugins/component-picker-block/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx index 2dd1129701..6ecae1d07c 100644 --- a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx @@ -94,7 +94,10 @@ const ComponentPicker = ({ ) const handleSelectWorkflowVariable = useCallback((variables: string[]) => { - editor.dispatchCommand(INSERT_WORKFLOW_VARIABLE_BLOCK_COMMAND, variables) + if (variables[1] === 'sys.query' || variables[1] === 'sys.files') + editor.dispatchCommand(INSERT_WORKFLOW_VARIABLE_BLOCK_COMMAND, [variables[1]]) + else + editor.dispatchCommand(INSERT_WORKFLOW_VARIABLE_BLOCK_COMMAND, variables) }, [editor]) const renderMenu = useCallback>((