Forbid custom expressions to be prefixed with defaults

94f53835f42e3f5305e555802ec870114dda4334

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +1 -1Showing whitespace changes
public/scripts/extensions/expressions/index.js+1 -1
@@ -1552,7 +1552,7 @@ async function onClickExpressionAddCustom() {
1552 toastr.warning('Invalid custom expression name provided', 'Add Custom Expression');1552 toastr.warning('Invalid custom expression name provided', 'Add Custom Expression');
1553 return;1553 return;
1554 }1554 }
1555 if (DEFAULT_EXPRESSIONS.includes(expressionName)) {1555 if (DEFAULT_EXPRESSIONS.includes(expressionName) || DEFAULT_EXPRESSIONS.some(x => expressionName.startsWith(x))) {
1556 toastr.warning('Expression name already exists', 'Add Custom Expression');1556 toastr.warning('Expression name already exists', 'Add Custom Expression');
1557 return;1557 return;
1558 }1558 }