Updated on 2026-08-14
This commit is contained in:
parent
a7a4d5733f
commit
57f0e83cdc
2 changed files with 20 additions and 6 deletions
|
|
@ -89,10 +89,7 @@ import com.tangem.feature.swap.domain.models.ExpressException
|
|||
import com.tangem.feature.swap.domain.models.SwapAmount
|
||||
import com.tangem.feature.swap.domain.models.domain.*
|
||||
import com.tangem.feature.swap.domain.models.ui.*
|
||||
import com.tangem.feature.swap.models.AddToPortfolioRoute
|
||||
import com.tangem.feature.swap.models.SwapAlertUM
|
||||
import com.tangem.feature.swap.models.SwapStateHolder
|
||||
import com.tangem.feature.swap.models.UiActions
|
||||
import com.tangem.feature.swap.models.*
|
||||
import com.tangem.feature.swap.models.market.SwapMarketsListBatchFlowManager
|
||||
import com.tangem.feature.swap.models.market.state.SwapMarketState
|
||||
import com.tangem.feature.swap.models.states.SwapNotificationUM
|
||||
|
|
@ -1424,6 +1421,13 @@ internal class SwapModel @Inject constructor(
|
|||
"updateFeePaidCryptoCurrencyFor: id = ${fromToken.currency.id}, " +
|
||||
"isOrderReversed: ${isOrderReversed.value}",
|
||||
)
|
||||
if ((uiState.sendCardData as? SwapCardState.SwapCardData)?.type is TransactionCardType.ReadOnly) {
|
||||
uiState = stateBuilder.createInitialLoadingState(
|
||||
initialCurrencyFrom = fromToken.currency,
|
||||
initialCurrencyTo = toToken.currency,
|
||||
fromNetworkInfo = fromToken.currency.getNetworkInfo(),
|
||||
)
|
||||
}
|
||||
updateFeePaidCryptoCurrencyFor(fromToken)
|
||||
startLoadingQuotes(
|
||||
fromToken = fromToken,
|
||||
|
|
@ -2021,6 +2025,14 @@ internal class SwapModel @Inject constructor(
|
|||
receiveBlockchain = toToken.currency.network.name,
|
||||
),
|
||||
)
|
||||
// Cancel periodic quote task if selected token is not supported
|
||||
singleTaskScheduler.cancelTask()
|
||||
// Reset data state
|
||||
dataState = SwapProcessDataState(
|
||||
tokensDataState = dataState.tokensDataState,
|
||||
)
|
||||
lastReducedBalanceBy.value = BigDecimal.ZERO
|
||||
lastAmount.value = INITIAL_AMOUNT
|
||||
uiState = stateBuilder.createSwapNotSupportedState(
|
||||
uiStateHolder = uiState,
|
||||
fromToken = fromToken,
|
||||
|
|
|
|||
|
|
@ -184,10 +184,12 @@ internal class StateBuilder(
|
|||
if (uiStateHolder.sendCardData !is SwapCardState.SwapCardData) return uiStateHolder
|
||||
return uiStateHolder.copy(
|
||||
sendCardData = SwapCardState.SwapCardData(
|
||||
type = requireNotNull(uiStateHolder.sendCardData.type as? TransactionCardType.Inputtable).copy(
|
||||
type = TransactionCardType.ReadOnly(
|
||||
accountTitleUM = getFromCardAccountTitle(fromAccount),
|
||||
),
|
||||
amountTextFieldValue = null,
|
||||
amountTextFieldValue = TextFieldValue(
|
||||
text = "0",
|
||||
),
|
||||
amountEquivalent = "0 ${appCurrencyProvider.invoke().symbol}",
|
||||
token = fromToken,
|
||||
tokenIconUrl = fromToken.currency.iconUrl,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue