Skip to content

fix(convert): disable Convert on Dollars when there is nothing to convert into - #973

Merged
bmc08gt merged 1 commit into
mainfrom
fix/convert-disabled-without-destination
Oct 5, 2026
Merged

bmc08gt merged 1 commit into
mainfrom
fix/convert-disabled-without-destination

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Converting out of Dollars needs another holding to buy into. With none, ConvertAmountViewModel's "largest other holding" fallback lands back on Dollars, so the flow would start a Dollars-for-Dollars convert. Android hit the same gap (Bugsnag 6ac36f88991833fd09434aad).

The Dollars screen's Convert tile is now disabled, not hidden and with no hint, unless the destination picker would list at least one entry. Both read the new Session.convertDestinations(from:rate:), which is balances(for:) minus the source. A zero-balance or non-displayable holding therefore leaves Convert disabled, including the stale zero row from the Android report.

Balances come from the database synchronously in Session.init, so there is no separate loading state: an empty list reads as no destination and the tile is disabled. The tile is also drawn only once the Dollars balance itself is present.

Convert on other currencies' screens is unchanged, since Dollars is always a destination there.

Tests: ConvertDestinationAvailabilityTests covers Dollars only, Dollars plus a held currency (enabled, opens on that currency), a zero-balance other holding, no balances, and a non-Dollars screen.

…vert into

Converting out of Dollars needs another holding to buy into. With none,
ConvertAmountViewModel's "largest other holding" fallback lands back on
Dollars, so the flow would start a Dollars-for-Dollars convert. Android
hit the same gap (Bugsnag 6ac36f88991833fd09434aad).

The Dollars screen's Convert tile is now disabled unless the destination
picker would list at least one entry. Both read the new
Session.convertDestinations(from:rate:), which is balances(for:) minus the
source, so a zero or non-displayable holding counts as nothing. Convert on
other currencies' screens is unchanged: Dollars is always a destination
there.
@bmc08gt bmc08gt self-assigned this Oct 5, 2026
@bmc08gt
bmc08gt merged commit d969f91 into main Oct 5, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant