Skip to content

Commit 280387d

Browse files
committed
check variable name list for uniqueness of name
1 parent 0e64a0e commit 280387d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

client/packages/lowcoder/src/comps/editorState.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,15 @@ export class EditorState {
493493
if (name !== oldName && this.nameAndExposingInfo().hasOwnProperty(name)) {
494494
return trans("comp.nameExists", { name: name });
495495
}
496+
497+
//Check query variable name duplication
498+
const queryComInfoList:string[] = [].concat(...(this.getQueriesComp()
499+
.toJsonValue().map((item: any) => item.variables.variables.map((v: any) => v.key))));
500+
501+
if (name !== oldName && queryComInfoList.includes(name)) {
502+
return trans("comp.nameExists", { name: name });
503+
}
504+
496505
return "";
497506
}
498507

0 commit comments

Comments
 (0)