From a0ea32a5faa70dd17ec2b6e5813fdaa67e419bdf Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 13 Dec 2023 19:52:53 +0100 Subject: [PATCH] web: Add workaround for '1' leaderboard trophy --- web/api/services/BrawlstarsService.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/api/services/BrawlstarsService.ts b/web/api/services/BrawlstarsService.ts index cc9d5d20..37d85970 100644 --- a/web/api/services/BrawlstarsService.ts +++ b/web/api/services/BrawlstarsService.ts @@ -76,6 +76,12 @@ export default class BrawlstarsService { public async getPlayerRanking(countryCode: string) { const response = await this.apiRequest<{ items: PlayerRanking[] }>(`rankings/${countryCode}/players`, 'fetch_player_rankings') + response.items.forEach(i => { + if (i.trophies == 1) { + // FIXME 2023-12-13: players above 100k trophies return '1' + i.trophies = 100000 + } + }) return response.items }