mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-05 10:50:48 +00:00
fix: correct error message for clan tag length (BUG-07) (#3946)
## Description: The code was checking `clanTag.length > MAX_CLAN_TAG_LENGTH` but returning `"tag_too_short"`. This fix corrects the error message to something more appropriate or ensures the logic matches the message. **Fix:** Corrected the error message key from `"tag_too_short"` to `"tag_too_long"` when the length exceeds the maximum. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: barfires Co-authored-by: Ryan <7389646+ryanbarlow97@users.noreply.github.com>
This commit is contained in:
@@ -58,7 +58,7 @@ export function validateClanTag(clanTag: string): {
|
||||
return { isValid: false, error: translateText("username.tag_too_short") };
|
||||
}
|
||||
if (clanTag.length > MAX_CLAN_TAG_LENGTH) {
|
||||
return { isValid: false, error: translateText("username.tag_too_short") };
|
||||
return { isValid: false, error: translateText("username.tag_too_long") };
|
||||
}
|
||||
|
||||
const parsed = ClanTagSchema.safeParse(clanTag);
|
||||
|
||||
Reference in New Issue
Block a user