Skip to content

Commit 853605a

Browse files
committed
fix(leaderboards): user button navigating to the wrong page
1 parent 61e0fd1 commit 853605a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/src/ts/pages/leaderboards.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,8 @@ function handleJumpButton(action: string, page?: number): void {
11091109
if (user) {
11101110
const rank = state.userData?.rank;
11111111
if (rank) {
1112-
const page = Math.floor(rank / state.pageSize);
1112+
// - 1 to make sure position 50 with page size 50 is on the first page (page 0)
1113+
const page = Math.floor(rank - 1 / state.pageSize);
11131114

11141115
if (state.page === page) {
11151116
return;

0 commit comments

Comments
 (0)