Skip to content

Commit bffe77d

Browse files
committed
chore(tokens): drop the unreachable sell branch from the swap success title (#1301)
Tearing out the v1 UI removed the Sell button from the token screen, which was the only place a SwapPurpose.Sell could be constructed. The v2 action row offers Give, Convert, and Withdraw, so nothing can reach the success title as a sell any more. The title's `else` arm existed to name the reserve for that case. Make the two reachable purposes explicit and let the fallback go unnamed rather than claim a destination it can no longer have; the suffix was already optional. title_cashReserves had no other reference, so it goes with it. SwapPurpose.Sell itself stays: it is unreachable but still referenced by SwapViewModel, AppRoute, and the sell receipt screen, so removing the type is a larger change than this one. canSell stays too — Convert reads it.
1 parent a0dfafb commit bffe77d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/flipcash/core/src/main/res/values/strings.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,6 @@
532532
<string name="label_blendModeColorDodge">Color Dodge</string>
533533
<string name="label_blendModePlusLighter">Plus Lighter</string>
534534

535-
<string name="title_cashReserves">USDF</string>
536535
<string name="action_buyMore">Buy More</string>
537536

538537
<string name="title_addMoney">Add Money</string>

‎apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal/TokenTxProcessingScreen.kt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ private fun TokenTxProcessingScreen(
136136
is SwapPurpose.Convert ->
137137
state.destinationTokenName.takeUnless { state.isConvertingToDollars }
138138
is SwapPurpose.BalanceIncrease -> state.tokenName
139-
else -> stringResource(R.string.title_cashReserves)
139+
// Selling is unreachable now that the v1 token screen is gone, and a
140+
// purpose is always set by the time a swap reaches this screen.
141+
else -> null
140142
}
141143
state.netTransferAmount.formatted(
142144
suffix = name?.let { stringResource(R.string.label_ofToken, it) },

0 commit comments

Comments
 (0)