Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: User gauges takes too much time to load on slow networks and fix loading indicator #11173

Merged

Conversation

memoyil
Copy link
Collaborator

@memoyil memoyil commented Feb 1, 2025


PR-Codex overview

This PR focuses on optimizing loading states and improving the handling of contract calls in the application. It adjusts batch sizes and refines how loading states are determined across various hooks.

Detailed summary

  • Reduced batchSize in apps/web/src/utils/viem.ts.
  • Changed isLoading logic in apps/web/src/views/GaugesVoting/components/Table/VoteTable/hooks/useGaugeRows.ts from AND to OR.
  • Added isLoading to the return of useVeCakeUserInfo in apps/web/src/views/CakeStaking/hooks/useVeCakeUserInfo.ts.
  • Updated useUserVoteSlopes to use isLoading for user info.
  • Refined contract call parameters in useUserVoteSlopes to explicitly include address and abi.
  • Enhanced query enabling logic in useUserVoteSlopes to consider isUserInfoLoading.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Feb 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 8:33am
7 Skipped Deployments
Name Status Preview Comments Updated (UTC)
aptos-web ⬜️ Ignored (Inspect) Visit Preview Feb 1, 2025 8:33am
blog ⬜️ Ignored (Inspect) Visit Preview Feb 1, 2025 8:33am
bridge ⬜️ Ignored (Inspect) Visit Preview Feb 1, 2025 8:33am
games ⬜️ Ignored (Inspect) Visit Preview Feb 1, 2025 8:33am
gamification ⬜️ Ignored (Inspect) Visit Preview Feb 1, 2025 8:33am
uikit ⬜️ Ignored (Inspect) Visit Preview Feb 1, 2025 8:33am
ton ⬜️ Skipped (Inspect) Feb 1, 2025 8:33am

Copy link

changeset-bot bot commented Feb 1, 2025

⚠️ No Changeset found

Latest commit: e8881aa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -87,8 +89,7 @@ export const useUserVoteSlopes = () => {
return []
}
},

enabled: Boolean(gauges?.length) && account && account !== '0x',
enabled: Boolean(gauges?.length) && !isUserInfoLoading && account && account !== '0x',
Copy link
Collaborator Author

@memoyil memoyil Feb 1, 2025

Choose a reason for hiding this comment

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

isUserInfoLoading is used to prevent trigger fetch without proxy calls when it is loading

@memoyil memoyil force-pushed the feature/fix_user_gauges_takes_too_much_time_to_load branch from ae3e579 to e8881aa Compare February 1, 2025 08:25
@vercel vercel bot temporarily deployed to Preview – ton February 1, 2025 08:26 Inactive
@memoyil memoyil changed the title fix: User gauges takes too much time to load fix: User gauges takes too much time to load and fix loading indicator Feb 1, 2025
@memoyil memoyil changed the title fix: User gauges takes too much time to load and fix loading indicator fix: User gauges takes too much time to load on slow networks and fix loading indicator Feb 1, 2025
@chef-ryan chef-ryan merged commit 2fef9ed into develop Feb 10, 2025
22 checks passed
@chef-ryan chef-ryan deleted the feature/fix_user_gauges_takes_too_much_time_to_load branch February 10, 2025 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants