Skip to content

Commit

Permalink
stop page from trying to load when at least 3 characters are required
Browse files Browse the repository at this point in the history
  • Loading branch information
zefanjajobse committed Nov 19, 2023
1 parent 3817a6d commit bf278a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/api/GametoolsApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ export class ApiProvider extends JsonClient {
platform,
lang,
}: PlatoonSearch): Promise<PlatoonSearchResult> {
if (name.length < 3)
return {
platoons: [],
cache: false,
apiUrl: this.constructApiUrl(`/bfglobal/platoons/`, {
name: name,
platform: platform,
lang: lang,
}),
};
return await this.getJsonMethod(`/bfglobal/platoons/`, {
name: name,
platform: platform,
Expand Down

0 comments on commit bf278a1

Please sign in to comment.