From 4bfb51ee526d91b2fd1c143e0b79b5b805da41a9 Mon Sep 17 00:00:00 2001 From: RonnyChan96 Date: Fri, 16 May 2025 12:24:48 +0800 Subject: [PATCH] [elsa] fix(GraphOperator): optimize single-key update handling --- framework/elsa/fit-elsa-react/src/data/GraphOperator.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/framework/elsa/fit-elsa-react/src/data/GraphOperator.js b/framework/elsa/fit-elsa-react/src/data/GraphOperator.js index 52fa1d863..0889fa632 100644 --- a/framework/elsa/fit-elsa-react/src/data/GraphOperator.js +++ b/framework/elsa/fit-elsa-react/src/data/GraphOperator.js @@ -79,6 +79,13 @@ const graphOperator = (graphString) => { if (!keys || keys.length === 0) { throw new Error('Keys cannot be empty'); } + + if (keys.length === 1) { + const config = getConfigByKeys(keys); + updateConfig(config, updates); + return; + } + // 获取除最后一层外的所有路径 const parentKeys = keys.slice(0, -1); const lastKey = keys[keys.length - 1];