From 4cf6ae6dbb0d336aa05c7ffd34f8121c603a95f4 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 17 Apr 2026 11:50:19 +0200 Subject: [PATCH] Updated on 2026-08-14 --- .../features/swap/v2/impl/amount/model/SwapAmountModel.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt index ecc249a62b..d4a45ef016 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt @@ -123,6 +123,7 @@ internal class SwapAmountModel @Inject constructor( private var lastAmountScreenOpenedCurrencyId: CryptoCurrency.ID? = null private var autoUpdateSubscriberJob: Job? = null + private var navigationJob: Job? = null val uiState: StateFlow field = MutableStateFlow(params.amountUM) @@ -137,7 +138,6 @@ internal class SwapAmountModel @Inject constructor( ?: UserCountry.Other(Locale.getDefault().country) isShowBestRateAnimation = swapBestRateAnimationStore.getSyncOrNull() } - configAmountNavigation() subscribeOnCryptoCurrencyStatusFlow() subscribeOnAmountUpdateTriggerUpdates() observeChooseSelectToken() @@ -149,6 +149,7 @@ internal class SwapAmountModel @Inject constructor( } fun onStart() { + configAmountNavigation() quoteTaskScheduler.scheduleTask( scope = modelScope, task = loadQuotesTask(), @@ -159,6 +160,7 @@ internal class SwapAmountModel @Inject constructor( fun onStop() { quoteTaskScheduler.cancelTask() autoUpdateSubscriberJob?.cancel() + navigationJob?.cancel() } override fun onDestroy() { @@ -871,7 +873,8 @@ internal class SwapAmountModel @Inject constructor( private fun configAmountNavigation() { val params = params as? SwapAmountComponentParams.AmountParams ?: return - combine( + navigationJob?.cancel() + navigationJob = combine( flow = uiState, flow2 = params.currentRoute, transform = { state, route -> state to route },