mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-11 09:06:36 +08:00
fix(leaderboards): user button navigating to the wrong page
This commit is contained in:
parent
61e0fd1590
commit
853605af24
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue