From 587d356bf3554349e689fd5b9ccce650d38388db Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 7 Nov 2025 11:31:03 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../sendviaswap/confirm/SendWithSwapConfirmComponent.kt | 2 +- .../sendviaswap/confirm/model/SendWithSwapConfirmModel.kt | 3 ++- .../swap/v2/impl/sendviaswap/model/SendWithSwapModel.kt | 6 ++++-- .../swap/converters/SavedSwapTransactionListConverter.kt | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt index 348a673fd5..0b4b6b742e 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt @@ -189,6 +189,6 @@ internal class SendWithSwapConfirmComponent @AssistedInject constructor( } interface ModelCallback { - fun onResult(sendWithSwapUM: SendWithSwapUM) + fun onResult(route: SendWithSwapRoute, sendWithSwapUM: SendWithSwapUM) } } \ No newline at end of file diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt index c4961dabf6..58c4d854b7 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt @@ -424,7 +424,8 @@ internal class SendWithSwapConfirmModel @Inject constructor( val confirmUM = state.confirmUM val isReadyToSend = confirmUM is ConfirmUM.Content && !confirmUM.isTransactionInProcess params.callback.onResult( - state.copy( + route = SendWithSwapRoute.Confirm, + sendWithSwapUM = state.copy( navigationUM = NavigationUM.Content( title = resourceReference(id = R.string.send_with_swap_confirm_title), subtitle = null, diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/model/SendWithSwapModel.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/model/SendWithSwapModel.kt index 357ffacf9c..3d6968a554 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/model/SendWithSwapModel.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/model/SendWithSwapModel.kt @@ -116,8 +116,10 @@ internal class SendWithSwapModel @Inject constructor( uiState.update { it.copy(destinationUM = destinationUM) } } - override fun onResult(sendWithSwapUM: SendWithSwapUM) { - uiState.value = sendWithSwapUM + override fun onResult(route: SendWithSwapRoute, sendWithSwapUM: SendWithSwapUM) { + if (currentRoute.value == route) { + uiState.value = sendWithSwapUM + } } override fun onNavigationResult(navigationUM: NavigationUM) { diff --git a/features/swap/data/src/main/java/com/tangem/feature/swap/converters/SavedSwapTransactionListConverter.kt b/features/swap/data/src/main/java/com/tangem/feature/swap/converters/SavedSwapTransactionListConverter.kt index 261e5f675c..f890932dfe 100644 --- a/features/swap/data/src/main/java/com/tangem/feature/swap/converters/SavedSwapTransactionListConverter.kt +++ b/features/swap/data/src/main/java/com/tangem/feature/swap/converters/SavedSwapTransactionListConverter.kt @@ -55,7 +55,7 @@ internal class SavedSwapTransactionListConverter( userWallet = userWallet, network = fromNetwork, ) ?: return null - val toNetwork = createSwapTransactionNetwork(fromToken, userWallet) ?: return null + val toNetwork = createSwapTransactionNetwork(toToken, userWallet) ?: return null val toCryptoCurrency = responseCryptoCurrenciesFactory.createCurrency( responseToken = toToken, userWallet = userWallet,