Skip to content

ClaimableBalanceCard silently discards claimBalance errors and never removes claimed rows #580

Description

@k-deejah

Problem

src/components/ClaimableBalanceCard.tsx BalanceRow.handleClaim handles the result of claimBalance with:

const { error } = await getClient().account.claimBalance(cb.id);
if (!error) setClaimed(true);

The else branch is entirely missing. When claimBalance returns an error string the button simply re-enables and nothing happens — users receive zero feedback. Additionally, if the API returns { data: null, error: null } (valid per the SorokitClient type), setClaimed(true) fires with no real ledger confirmation.

Two more related problems: (1) after a successful claim the row stays visible with a "Claimed" badge but is never removed from the list, leaving the count badge in the header stale; (2) there is no loading guard preventing a second Claim click while the first is in-flight.

Solution

Add a local claimError state to BalanceRow and display it inline on failure. Verify data is non-null before setting claimed. Lift a removal callback from the parent so the claimed row is removed after success. Disable the Claim button while claiming is true.

Acceptance Criteria

  • A failed claimBalance call shows an inline error message below the Claim button
  • claimed is only set to true when data is non-null
  • Successfully claimed row is removed from the visible list
  • The header count badge updates to reflect remaining claimable balances
  • The Claim button is disabled while a claim is in-flight
  • Claiming one row does not affect other rows in the list

Note for Contributors: If you're assigned to this issue, write a clear and detailed description for your pull request. Explain what was changed, why it was needed, how it was implemented, and include any relevant testing or screenshots where applicable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfrontendUI, component, or visual layer concern

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions