feat: search min and max lengths

This commit is contained in:
tresabhi committed 2024-12-14 13:27:45 -06:00
1 parent 3b429a6c05
commit 73cb3873d9
6 files changed
+64 -7

No files matched your search

@@ -11,10 +11,11 @@ export type AccountListWithServer = (AccountListItem & {
})[];
export async function searchPlayersAcrossRegions(search: string, limit = 25) {
const trimmedSearch = search.trim();
const trimmed = search.trim();
if (trimmed.length < 3 && trimmed.length > 100) return [];
const normalizedLimit = Math.floor(limit / 3);
if (usernamePattern.test(trimmedSearch)) {
if (usernamePattern.test(trimmed)) {
return (
await Promise.all([
fetchBlitz<AccountList>('com', 'account/list', {