feat: autocomplete size limits

This commit is contained in:
TrèsAbhi committed 2023-11-01 11:45:19 -05:00
1 parent 882e61ff44
commit 3ea77f5899
5 files changed
+88 -45

No files matched your search

+2 -2
View File
@@ -16,10 +16,10 @@ export const usernamePatternWithoutPosition = /[a-zA-Z0-9_]{3,24}/;
export default async function searchPlayersAcrossRegions(
search: string,
limit = 9,
limit = 25,
) {
const trimmedSearch = search.trim();
const normalizedLimit = Math.round(limit / 3);
const normalizedLimit = Math.floor(limit / 3);
const encodedSearch = encodeURIComponent(trimmedSearch);
if (usernamePattern.test(trimmedSearch)) {