You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Check if the name is duplicated within the same blockType
39
+
isDuplicated(
40
+
block: any,
41
+
blockType: BlockType,
42
+
injectError?: (errorMsg: string)=>void,
43
+
): boolean{
44
+
// Not checking any null or undefined object
45
+
if(block===null||block===undefined){
46
+
returnfalse;
47
+
}
48
+
49
+
switch(blockType){
50
+
case"rules":
51
+
if(this.isRuleDuplicated(block)){
52
+
injectError?.(
53
+
`Duplicate rules${typeofblock==="string" ? "" : ` named ${block.name}`} detected. The duplicate one has been deleted for preventing unexpected behavior.`,
54
+
);
55
+
returntrue;
56
+
}
57
+
returnfalse;
58
+
case"context":
59
+
if(this.isContextDuplicated(block)){
60
+
injectError?.(
61
+
`Duplicate ${block.provider} context providers detected. The duplicate one has been deleted for preventing unexpected behavior.`,
0 commit comments