Skip to content

Commit

Permalink
fix(leaderboards): user button navigating to the wrong page
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Mar 4, 2025
1 parent 61e0fd1 commit 853605a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/ts/pages/leaderboards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,8 @@ function handleJumpButton(action: string, page?: number): void {
if (user) {
const rank = state.userData?.rank;
if (rank) {
const page = Math.floor(rank / state.pageSize);
// - 1 to make sure position 50 with page size 50 is on the first page (page 0)
const page = Math.floor(rank - 1 / state.pageSize);

if (state.page === page) {
return;
Expand Down

0 comments on commit 853605a

Please sign in to comment.