Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 917880e

Browse files
Check for uniqueness of variable name within new cloned query
1 parent 0cd9490 commit 917880e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎client/packages/lowcoder/src/comps/queries/queryComp.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,15 @@ class QueryListComp extends QueryListTmpComp implements BottomResListComp {
777777

778778
const jsonData = originQuery.toJsonValue();
779779
//Regenerate variable header
780+
const newKeys:string[] = [];
780781
jsonData.variables?.variables?.forEach(kv => {
781782
const [prefix, _] = (kv.key as string).split(/(?=\d+$)/);
782783
let i=1, newName = "";
783784
do {
784785
newName = prefix + (i++);
785-
} while(editorState.checkRename("", newName));
786+
} while(editorState.checkRename("", newName)||newKeys.includes(newName));
786787
kv.key = newName;
788+
newKeys.push(newName);
787789
})
788790

789791
const newQueryName = this.genNewName(editorState);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /