Forbid custom expressions to be prefixed with defaults

This commit is contained in:
Cohee 2025-02-21 00:29:05 +02:00
parent 3574527780
commit 94f53835f4

View File

@ -1552,7 +1552,7 @@ async function onClickExpressionAddCustom() {
toastr.warning('Invalid custom expression name provided', 'Add Custom Expression');
return;
}
if (DEFAULT_EXPRESSIONS.includes(expressionName)) {
if (DEFAULT_EXPRESSIONS.includes(expressionName) || DEFAULT_EXPRESSIONS.some(x => expressionName.startsWith(x))) {
toastr.warning('Expression name already exists', 'Add Custom Expression');
return;
}