From d98f3072fb732fff3bde2256b08137786179643f Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Fri, 21 Aug 2026 16:01:50 -0400 Subject: [PATCH] chore(tokens): drop the unreachable sell branch from the swap success title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- apps/flipcash/core/src/main/res/values/strings.xml | 1 - .../app/tokens/internal/TokenTxProcessingScreen.kt | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/flipcash/core/src/main/res/values/strings.xml b/apps/flipcash/core/src/main/res/values/strings.xml index 7de827035..f09902708 100644 --- a/apps/flipcash/core/src/main/res/values/strings.xml +++ b/apps/flipcash/core/src/main/res/values/strings.xml @@ -536,7 +536,6 @@ Color Dodge Plus Lighter - USDF Buy More Add Money diff --git a/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal/TokenTxProcessingScreen.kt b/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal/TokenTxProcessingScreen.kt index a68130b5b..8c1d484c1 100644 --- a/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal/TokenTxProcessingScreen.kt +++ b/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal/TokenTxProcessingScreen.kt @@ -130,9 +130,13 @@ private fun TokenTxProcessingScreen( val name = when (state.purpose) { is SwapPurpose.Convert -> state.destinationTokenName is SwapPurpose.BalanceIncrease -> state.tokenName - else -> stringResource(R.string.title_cashReserves) + // Selling is unreachable now that the v1 token screen is gone, and a + // purpose is always set by the time a swap reaches this screen. + else -> null } - state.netTransferAmount.formatted(suffix = stringResource(R.string.label_ofToken, name)) + state.netTransferAmount.formatted( + suffix = name?.let { stringResource(R.string.label_ofToken, it) }, + ) } }, style = CodeTheme.typography.textLarge,