Skip to content

Commit 9491cb9

Browse files
authored
Merge pull request #1511 from lowcoder-org/fix/global_unique_variable_name
check variable name list for uniqueness of name
2 parents 1f6ed88 + 280387d commit 9491cb9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy