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

Conversation

MazurakIhor
Copy link
Contributor

@MazurakIhor MazurakIhor commented Oct 12, 2023

Right now, calculation of maxPage works incorrectly.
Let's assume leaderboard list contains 5 records.
pageNumber is equal to 1
PAGE_SIZE is equal to 10.

const maxPage = maxUsers / PAGE_SIZE;

maxPage = 5 / 10 = 0.5
Controls are disabled if pageNumber === maxPage. Since pageNumber == 1 and maxPage == 0.5, 'Next' and 'Prev' buttons aren't disabled as values aren't equal.

Implemented fix to round up maxPage to the next integer

…s are disabled when table contains less than 10 rows.
@stellar-jenkins
Copy link

@MazurakIhor
Copy link
Contributor Author

image

@MazurakIhor MazurakIhor changed the title Corrected calculation of total pages so that 'Prev' and 'Next' buttons are disabled when table contains less than 10 rows. Corrected calculation of total pages. Oct 12, 2023
@MazurakIhor MazurakIhor changed the title Corrected calculation of total pages. Corrected calculation of max pages. Oct 13, 2023
Copy link
Contributor

@Julian-dev28 Julian-dev28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the update!

@Julian-dev28 Julian-dev28 merged commit f71bded into stellar-deprecated:main Oct 13, 2023
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants