-
Notifications
You must be signed in to change notification settings - Fork 77
fix(provider): added a balance load check to prevent balance popup #2200
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdded explicit loading-state tracking for wallet balances in ServerAccess. The component now requires balance data to be loaded before performing balance checks, gating the Next action and showing a loading hint until balances are available. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as ServerAccess UI
participant Wallet as WalletBalancesStore
participant Flow as Navigation/Next
Note over Wallet,UI `#D3E4FF`: Initial load
UI->>Wallet: request balances
Wallet-->>UI: balances = null (loading)
UI->>UI: show "loading balance" hint, disable Next
Note over Wallet,UI `#D3FFD8`: When data arrives
Wallet-->>UI: balances (loaded)
UI->>UI: isBalanceLoaded = true
alt balance >= MIN_BALANCE
UI->>Flow: allow Next (proceed)
else balance < MIN_BALANCE
UI->>UI: show insufficient balance popup
UI-xFlow: block Next
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2200 +/- ##
==========================================
- Coverage 47.19% 46.85% -0.35%
==========================================
Files 1023 1013 -10
Lines 29078 28729 -349
Branches 7584 7543 -41
==========================================
- Hits 13724 13461 -263
+ Misses 14961 14884 -77
+ Partials 393 384 -9
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/provider-console/src/components/become-provider/ServerAccess.tsx(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Never use type any or cast to type any. Always define the proper TypeScript types.
Files:
apps/provider-console/src/components/become-provider/ServerAccess.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code
Files:
apps/provider-console/src/components/become-provider/ServerAccess.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test-build
🔇 Additional comments (2)
apps/provider-console/src/components/become-provider/ServerAccess.tsx (2)
28-29: Good addition of explicit loading state.The separation of
isBalanceLoadedandhasEnoughBalancecorrectly distinguishes between three states: not loaded, loaded but insufficient, and loaded with sufficient balance. This prevents premature balance checks.
41-44: Correctly gates the balance popup on loading state.The condition
isBalanceLoaded && !hasEnoughBalanceensures the popup only displays when wallet data has loaded and the balance is actually insufficient, preventing premature popup triggers.
Summary by CodeRabbit
Bug Fixes
New Features