From fcbdca43f41d19670bcf2e7f0834236031d291f2 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 20 Nov 2024 14:19:21 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../feature/swap/viewmodels/SwapViewModel.kt | 18 ++++++------------ .../plugin/configuration/model/AppConfig.kt | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/viewmodels/SwapViewModel.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/viewmodels/SwapViewModel.kt index 3aa4b23a82..8250eaf93b 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/viewmodels/SwapViewModel.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/viewmodels/SwapViewModel.kt @@ -102,7 +102,6 @@ internal class SwapViewModel @Inject constructor( get() = if (walletFeatureToggles.isMainActionButtonsEnabled) { savedStateHandle.get(AppRoute.Swap.CURRENCY_TO_KEY) ?.unbundle(CryptoCurrency.serializer()) - ?: error("no expected parameter CryptoCurrency (to) found") } else { null } @@ -172,8 +171,7 @@ internal class SwapViewModel @Inject constructor( val fromStatus = getCryptoCurrencyStatusUseCase(userWalletId, initialCurrencyFrom.id).getOrNull() val toStatus = initialCurrencyTo?.let { getCryptoCurrencyStatusUseCase(userWalletId, it.id).getOrNull() } val wallet = getUserWalletUseCase(userWalletId).getOrNull() - val isStatusToNull = walletFeatureToggles.isMainActionButtonsEnabled && toStatus == null - if (fromStatus == null || wallet == null || isStatusToNull) { + if (fromStatus == null || wallet == null) { uiState = stateBuilder.addAlert(uiState = uiState, onDismiss = swapRouter::back) } else { userWallet = wallet @@ -228,15 +226,11 @@ internal class SwapViewModel @Inject constructor( swapInteractor.getTokensDataState(initialCurrencyFrom) }.onSuccess { state -> updateTokensState(state) - val selectedCurrency = if (walletFeatureToggles.isMainActionButtonsEnabled) { - initialToStatus - } else { - swapInteractor.getInitialCurrencyToSwap( - initialCryptoCurrency = initialCurrencyFrom, - state = state, - isReverseFromTo = isReverseFromTo, - ) - } + val selectedCurrency = initialToStatus ?: swapInteractor.getInitialCurrencyToSwap( + initialCryptoCurrency = initialCurrencyFrom, + state = state, + isReverseFromTo = isReverseFromTo, + ) applyInitialTokenChoice( state = state, diff --git a/plugins/configuration/src/main/kotlin/com/tangem/plugin/configuration/model/AppConfig.kt b/plugins/configuration/src/main/kotlin/com/tangem/plugin/configuration/model/AppConfig.kt index 9f9e73f5ff..3db7478662 100644 --- a/plugins/configuration/src/main/kotlin/com/tangem/plugin/configuration/model/AppConfig.kt +++ b/plugins/configuration/src/main/kotlin/com/tangem/plugin/configuration/model/AppConfig.kt @@ -3,7 +3,7 @@ package com.tangem.plugin.configuration.model internal object AppConfig { const val packageName = "com.tangem.wallet" const val versionCode = 1 - const val versionName = "5.19.0-SNAPSHOT" + const val versionName = "1.0.0-SNAPSHOT" // const val versionName = "100.0.0-SNAPSHOT" //TODO: [REDACTED_JIRA] const val minSdkVersion = 24 const val targetSdkVersion = 34