Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: display issue in explorer indexers (#981)
explore seems to be missing a few indexers and the reason was due to pagination starting from 0. so on load it would grab the intial 50 and then onclick for loadmore it would still grab the 0-50 already on display. fix: changes page to intialize to 1. Initial Load (0-49) Indexers Loaded First Click (page = 1): Loads indexers from 50 to 99. Second Click (page = 2): Loads indexers from 100 to 149. ``` const handleLoadMore = () => { const start = page * PAGE_SIZE; // FIRST: 1*50 = 50 -> SECOND: 2*50 = 100 const end = start + PAGE_SIZE; // FIRST: 50+50 = 100 -> SECOND: 100+50 = 150 const newIndexers = indexers.slice(start, end); // FIRST CLICK: 50-99 -> SECOND CLICK: 100-149 setCurrentPageIndexer([...currentPageIndexer, ...newIndexers]); // FIRST: 0-49 + 50-99, SECOND: 0-99 + 100 - 149 setPage(page + 1); }; ```
- Loading branch information