Updated on 2026-08-14
This commit is contained in:
parent
a5914f689f
commit
fcbdca43f4
2 changed files with 7 additions and 13 deletions
|
|
@ -102,7 +102,6 @@ internal class SwapViewModel @Inject constructor(
|
||||||
get() = if (walletFeatureToggles.isMainActionButtonsEnabled) {
|
get() = if (walletFeatureToggles.isMainActionButtonsEnabled) {
|
||||||
savedStateHandle.get<Bundle>(AppRoute.Swap.CURRENCY_TO_KEY)
|
savedStateHandle.get<Bundle>(AppRoute.Swap.CURRENCY_TO_KEY)
|
||||||
?.unbundle(CryptoCurrency.serializer())
|
?.unbundle(CryptoCurrency.serializer())
|
||||||
?: error("no expected parameter CryptoCurrency (to) found")
|
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
@ -172,8 +171,7 @@ internal class SwapViewModel @Inject constructor(
|
||||||
val fromStatus = getCryptoCurrencyStatusUseCase(userWalletId, initialCurrencyFrom.id).getOrNull()
|
val fromStatus = getCryptoCurrencyStatusUseCase(userWalletId, initialCurrencyFrom.id).getOrNull()
|
||||||
val toStatus = initialCurrencyTo?.let { getCryptoCurrencyStatusUseCase(userWalletId, it.id).getOrNull() }
|
val toStatus = initialCurrencyTo?.let { getCryptoCurrencyStatusUseCase(userWalletId, it.id).getOrNull() }
|
||||||
val wallet = getUserWalletUseCase(userWalletId).getOrNull()
|
val wallet = getUserWalletUseCase(userWalletId).getOrNull()
|
||||||
val isStatusToNull = walletFeatureToggles.isMainActionButtonsEnabled && toStatus == null
|
if (fromStatus == null || wallet == null) {
|
||||||
if (fromStatus == null || wallet == null || isStatusToNull) {
|
|
||||||
uiState = stateBuilder.addAlert(uiState = uiState, onDismiss = swapRouter::back)
|
uiState = stateBuilder.addAlert(uiState = uiState, onDismiss = swapRouter::back)
|
||||||
} else {
|
} else {
|
||||||
userWallet = wallet
|
userWallet = wallet
|
||||||
|
|
@ -228,15 +226,11 @@ internal class SwapViewModel @Inject constructor(
|
||||||
swapInteractor.getTokensDataState(initialCurrencyFrom)
|
swapInteractor.getTokensDataState(initialCurrencyFrom)
|
||||||
}.onSuccess { state ->
|
}.onSuccess { state ->
|
||||||
updateTokensState(state)
|
updateTokensState(state)
|
||||||
val selectedCurrency = if (walletFeatureToggles.isMainActionButtonsEnabled) {
|
val selectedCurrency = initialToStatus ?: swapInteractor.getInitialCurrencyToSwap(
|
||||||
initialToStatus
|
initialCryptoCurrency = initialCurrencyFrom,
|
||||||
} else {
|
state = state,
|
||||||
swapInteractor.getInitialCurrencyToSwap(
|
isReverseFromTo = isReverseFromTo,
|
||||||
initialCryptoCurrency = initialCurrencyFrom,
|
)
|
||||||
state = state,
|
|
||||||
isReverseFromTo = isReverseFromTo,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
applyInitialTokenChoice(
|
applyInitialTokenChoice(
|
||||||
state = state,
|
state = state,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package com.tangem.plugin.configuration.model
|
||||||
internal object AppConfig {
|
internal object AppConfig {
|
||||||
const val packageName = "com.tangem.wallet"
|
const val packageName = "com.tangem.wallet"
|
||||||
const val versionCode = 1
|
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 versionName = "100.0.0-SNAPSHOT" //TODO: [REDACTED_JIRA]
|
||||||
const val minSdkVersion = 24
|
const val minSdkVersion = 24
|
||||||
const val targetSdkVersion = 34
|
const val targetSdkVersion = 34
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue