-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix: User gauges takes too much time to load on slow networks and fix loading indicator #11173
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
7 Skipped Deployments
|
|
@@ -87,8 +89,7 @@ export const useUserVoteSlopes = () => { | |||
return [] | |||
} | |||
}, | |||
|
|||
enabled: Boolean(gauges?.length) && account && account !== '0x', | |||
enabled: Boolean(gauges?.length) && !isUserInfoLoading && account && account !== '0x', |
There was a problem hiding this comment.
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
ae3e579
to
e8881aa
Compare
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
batchSize
inapps/web/src/utils/viem.ts
.isLoading
logic inapps/web/src/views/GaugesVoting/components/Table/VoteTable/hooks/useGaugeRows.ts
from AND to OR.isLoading
to the return ofuseVeCakeUserInfo
inapps/web/src/views/CakeStaking/hooks/useVeCakeUserInfo.ts
.useUserVoteSlopes
to useisLoading
for user info.useUserVoteSlopes
to explicitly includeaddress
andabi
.useUserVoteSlopes
to considerisUserInfoLoading
.