Merge pull request #506 from kinode-dao/dr/disallow-capitals-in-register

This commit is contained in:
doria 2024-08-26 18:24:49 -04:00 committed by GitHub
commit ca4c7487e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -3749,8 +3749,6 @@
},
"node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/napi-wasm/-/napi-wasm-1.1.0.tgz",
"integrity": "sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==",
"inBundle": true,
"license": "MIT"
},

View File

@ -47,6 +47,12 @@ function EnterKnsName({
let validities: string[] = [];
setIsPunyfied('');
if (/[A-Z]/.test(name)) {
validities.push(NAME_URL);
setNameValidities(validities);
return;
}
let normalized = ''
index = validities.indexOf(NAME_INVALID_PUNY);
try {
@ -69,7 +75,9 @@ function EnterKnsName({
index = validities.indexOf(NAME_URL);
if (name !== "" && !isValidDomain(normalized)) {
if (index === -1) validities.push(NAME_URL);
} else if (index !== -1) validities.splice(index, 1);
} else if (index !== -1) {
validities.splice(index, 1);
}
index = validities.indexOf(NAME_CLAIMED);