fix for gas used to be shown only to migrating users#335
Conversation
WalkthroughThe change updates the Changes
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/apps/leaderboard/components/PxPointsSummary/PxPointsSummary.tsx (1)
50-54: Consider memoising repetitive look-ups
findMatchingEntryis invoked four times on every render, doing an O(n × m) search each time. Wrapping each call inuseMemo(with the relevant data arrays as dependencies) will avoid unnecessary recomputation and reduce CPU churn on large leaderboards.-const myAllTimeTrading = findMatchingEntry(allTimeTradingData); -const myAllTimeMigration = findMatchingEntry(allTimeMigrationData); -const myAllTimeMerged = findMatchingEntry(mergedAllTimeData); -const myWeeklyMerged = findMatchingEntry(mergedWeeklyTimeData); +const myAllTimeTrading = useMemo( + () => findMatchingEntry(allTimeTradingData), + [allTimeTradingData, walletAddress], +); +const myAllTimeMigration = useMemo( + () => findMatchingEntry(allTimeMigrationData), + [allTimeMigrationData, walletAddress], +); +const myAllTimeMerged = useMemo( + () => findMatchingEntry(mergedAllTimeData), + [mergedAllTimeData, walletAddress], +); +const myWeeklyMerged = useMemo( + () => findMatchingEntry(mergedWeeklyTimeData), + [mergedWeeklyTimeData, walletAddress], +);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/apps/leaderboard/components/PxPointsSummary/PxPointsSummary.tsx(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: lint
- GitHub Check: unit-tests
- GitHub Check: build
🔇 Additional comments (1)
src/apps/leaderboard/components/PxPointsSummary/PxPointsSummary.tsx (1)
134-137: DynamicisMigratedflag is a solid fixChanging the prop from a hard-coded
trueto the actualisUserInMigrationDatastate correctly scopes the “gas used” drop card to migrated users only. No further action needed.
Deploying x with
|
| Latest commit: |
23c0585
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://704fc66c.x-e62.pages.dev |
| Branch Preview URL: | https://feat-px-points-migration-boa.x-e62.pages.dev |
Description
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Summary by CodeRabbit