From 59e808b63b47da5172b84f5c00fe68907b8df179 Mon Sep 17 00:00:00 2001 From: Wraith <54374743+wraith4081@users.noreply.github.com> Date: Thu, 5 Feb 2026 22:35:49 +0300 Subject: [PATCH] fix(leaderboards): update & move reached_limit check (#3128) If this PR fixes an issue, link it below. If not, delete these two lines. Resolves #3126 ## Description: update & move reached_limit check ## 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: wraith4081 --------- Co-authored-by: Ryan <7389646+ryanbarlow97@users.noreply.github.com> --- src/client/Api.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/client/Api.ts b/src/client/Api.ts index d128ad2f2..7a18dea8a 100644 --- a/src/client/Api.ts +++ b/src/client/Api.ts @@ -235,13 +235,6 @@ export async function fetchPlayerLeaderboard( }); if (!res.ok) { - // Handle "Page must be between X and Y" error as end of list - if (res.status === 400) { - const errorJson = await res.json().catch(() => null); - if (errorJson?.message?.includes("Page must be between")) { - return "reached_limit"; - } - } console.warn( "fetchPlayerLeaderboard: unexpected status", res.status, @@ -253,6 +246,10 @@ export async function fetchPlayerLeaderboard( const json = await res.json(); const parsed = RankedLeaderboardResponseSchema.safeParse(json); if (!parsed.success) { + // Handle "Page must be between X and Y" error as end of list + if (json?.message?.includes?.("Page must be between")) { + return "reached_limit"; + } console.warn( "fetchPlayerLeaderboard: Zod validation failed", parsed.error.toString(),