From 9d67533aa36e38fa5b26c5f56c062bfe0f5dd945 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 10 Jan 2025 14:30:36 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../WalletCurrencyActionsClickIntents.kt | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletCurrencyActionsClickIntents.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletCurrencyActionsClickIntents.kt index a2fa5ca344..43630b4d4b 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletCurrencyActionsClickIntents.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletCurrencyActionsClickIntents.kt @@ -314,16 +314,26 @@ internal class WalletCurrencyActionsClickIntentsImplementor @Inject constructor( if (handleUnavailabilityReason(unavailabilityReason)) return - showErrorIfDemoModeOrElse { - viewModelScope.launch(dispatchers.main) { - reduxStateHolder.dispatch( - TradeCryptoAction.Buy( - userWallet = userWallet, - source = OnrampSource.TOKEN_LONG_TAP, - cryptoCurrencyStatus = cryptoCurrencyStatus, - appCurrencyCode = getSelectedAppCurrencyUseCase.unwrap().code, - ), - ) + if (onrampFeatureToggles.isFeatureEnabled) { + appRouter.push( + AppRoute.Onramp( + userWalletId = userWallet.walletId, + currency = cryptoCurrencyStatus.currency, + source = OnrampSource.TOKEN_LONG_TAP, + ), + ) + } else { + showErrorIfDemoModeOrElse { + viewModelScope.launch(dispatchers.main) { + reduxStateHolder.dispatch( + TradeCryptoAction.Buy( + userWallet = userWallet, + source = OnrampSource.TOKEN_LONG_TAP, + cryptoCurrencyStatus = cryptoCurrencyStatus, + appCurrencyCode = getSelectedAppCurrencyUseCase.unwrap().code, + ), + ) + } } } }