Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Corrected calculation of max pages. #611

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/molecules/leaderboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Leaderboard: React.FC<Props> = ({ userId, list, isLoading, onLoad }) => {
const [pageNumber, setPageNumber] = useState(1);

const maxUsers = list[0]?.ranking.total;
const maxPage = maxUsers / PAGE_SIZE;
const maxPage = Math.ceil(maxUsers / PAGE_SIZE);

const onSort = (val: LeaderboardColumn) => {
// if click on current column ? change direction : set default direction
Expand Down