-
Notifications
You must be signed in to change notification settings - Fork 231
[FIX] Total balance not updated when withdrawal completes #641
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] Total balance not updated when withdrawal completes #641
Conversation
WalkthroughThis change adds an event listener for the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant SA as sendAction
participant SST as sendSignedTransaction
participant R as Router
U->>SA: Initiates transaction sending
SA->>SST: Calls sendSignedTransaction
SST-->>SA: Emits receipt event
SA->>R: Calls router.go(0) to reload page
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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
Documentation and Community
|
|
cc: @kvhnuke for review. Thank you. |
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: 0
🧹 Nitpick comments (1)
packages/extension/src/providers/ethereum/ui/send-transaction/verify-transaction/index.vue (1)
221-221: The fix addresses the balance update issue effectively.Adding a page reload when the transaction receipt is received should successfully solve the reported problem by ensuring the total balance gets refreshed after a withdrawal completes.
While this solution works, consider a more targeted approach in the future that wouldn't require a full page reload:
-.on('receipt', () => router.go(0)) +.on('receipt', () => { + // Emit an event that balance components can listen for + const balanceUpdateEvent = new CustomEvent('balance:update', { + detail: { address: txData.fromAddress, network: network.value.name } + }); + window.dispatchEvent(balanceUpdateEvent); +})This would require corresponding listeners in your balance components but would provide a smoother user experience without losing application state.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/extension/src/providers/ethereum/ui/send-transaction/verify-transaction/index.vue(1 hunks)
|
@ahsan-javaiid can you rebase with latest changes |
aa77ce6 to
20d670c
Compare
Done! |
20d670c to
c1b7136
Compare
5af58a9
into
enkryptcom:devop/packeupdates-0512
Description
This PR fixes the issue of total balance not refreshing after tx confirms. Due to this issue the individual and total balances does not match. When the withdrawal is processed, it is needed to refresh in order to see the total balance update.
Tested this on couple of EVM chains, it's happening on all EVM chains.
Snapshots
Summary by CodeRabbit