fix(ClaimableBalanceCard): remove claimed rows and surface claim errors - #517
Open
Sam-Rytech wants to merge 1 commit into
Open
fix(ClaimableBalanceCard): remove claimed rows and surface claim errors#517Sam-Rytech wants to merge 1 commit into
Sam-Rytech wants to merge 1 commit into
Conversation
Closes Sorokit#441 After a successful claim the row was only flagged with a "Claimed" badge. The list was never updated, so the balance came straight back on the next mount or refresh because the card re-fetches the full list from the server. - BalanceRow now reports a successful claim upward via `onClaimed(id)`, and ClaimableBalanceCard removes that balance from `balances` immediately (optimistic update). - A post-claim re-fetch keeps the list server-consistent; claimed ids are tracked in a ref and filtered out of the response so a lagging server cannot resurrect the row. The refresh is a background one, so the card does not flash its loading skeleton. - Failed claims render an inline `role="alert"` message on the affected row, wrapped instead of truncated, and the button returns to its normal state so the user can retry. - claimBalance, getClaimableBalances and clipboard writes are all caught, so a rejection can no longer escape as an unhandled promise rejection or pin the card in its loading state. Tests: the existing suite still mocked the removed `getClient` entrypoint (the client moved to SorokitContext), so the mocks are updated to the hook and the claim-flow cases now assert row removal, inline errors, retry and rejection handling. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@Sam-Rytech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #441
After a successful claim the row was only flagged with a "Claimed" badge. The list was never updated, so the balance came straight back on the next mount or refresh because the card re-fetches the full list from the server.
onClaimed(id), and ClaimableBalanceCard removes that balance frombalancesimmediately (optimistic update).role="alert"message on the affected row, wrapped instead of truncated, and the button returns to its normal state so the user can retry.Tests: the existing suite still mocked the removed
getCliententrypoint (the client moved to SorokitContext), so the mocks are updated to the hook and the claim-flow cases now assert row removal, inline errors, retry and rejection handling.