fix: implement API pagination for contract event fetching (#214)#219
Merged
fix: implement API pagination for contract event fetching (#214)#219
Conversation
- RecentTips: add Load More button to fetch beyond initial 50 events - TipHistory: add Load More button with offset-based API pagination - Leaderboard: auto-paginate up to 500 events (10 pages) for accurate rankings, with manual Load More for additional data - All components now display total event counts from the API - Replaced hardcoded limit=50&offset=0 with configurable API_LIMIT constant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #214 — Contract event fetching was limited to 50 results with no API pagination.
Changes
RecentTips.jsx
API_LIMITconstant and pagination state (apiOffset,hasMore,loadingMore,totalApiEvents)loadMoreTipscallback fetches next page and appends resultsTipHistory.jsx
loadMoreTipscallback fetches next page, filters by user address, and appendsLeaderboard.jsx
loadMoreEventscallback fetches additional pages and rebuilds leaderboard stats