Skip to content

Commit c487977

Browse files
authored
[elsa] fix(GraphOperator): optimize single-key update handling (#128)
1 parent ff19fbe commit c487977

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

framework/elsa/fit-elsa-react/src/data/GraphOperator.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ const graphOperator = (graphString) => {
7979
if (!keys || keys.length === 0) {
8080
throw new Error('Keys cannot be empty');
8181
}
82+
83+
if (keys.length === 1) {
84+
const config = getConfigByKeys(keys);
85+
updateConfig(config, updates);
86+
return;
87+
}
88+
8289
// 获取除最后一层外的所有路径
8390
const parentKeys = keys.slice(0, -1);
8491
const lastKey = keys[keys.length - 1];

0 commit comments

Comments
 (0)