From 90ca98ff3aa8a4ef981c523d3c1bdbe7132d1f2f Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 5 Jun 2025 16:41:04 +0800 Subject: [PATCH] fix: in node show rag var --- .../variable-assigner/components/node-variable-item.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow/nodes/variable-assigner/components/node-variable-item.tsx b/web/app/components/workflow/nodes/variable-assigner/components/node-variable-item.tsx index 81286e21f8..b4fc76d548 100644 --- a/web/app/components/workflow/nodes/variable-assigner/components/node-variable-item.tsx +++ b/web/app/components/workflow/nodes/variable-assigner/components/node-variable-item.tsx @@ -38,7 +38,13 @@ const NodeVariableItem = ({ const isEnv = isENV(variable) const isChatVar = isConversationVar(variable) const isRagVar = isRagVariableVar(variable) - const varName = isSystem ? `sys.${variable[variable.length - 1]}` : variable.slice(1).join('.') + const varName = useMemo(() => { + if(isSystem) + return `sys.${variable[variable.length - 1]}` + if(isRagVar) + return variable[variable.length - 1] + return variable.slice(1).join('.') + }, [isRagVar, isSystem, variable]) const VariableIcon = useMemo(() => { if (isEnv) {