Updated on 2026-08-14

This commit is contained in:
Tangem 2023-12-13 12:06:36 +03:00
parent 64423bdf6f
commit 203b66f6ed
2 changed files with 12 additions and 3 deletions

View file

@ -12,11 +12,11 @@ import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.tokens.model.CryptoCurrency
import com.tangem.domain.tokens.model.CryptoCurrencyStatus
import com.tangem.feature.swap.converters.TokensDataConverter
import com.tangem.feature.swap.domain.models.domain.*
import com.tangem.feature.swap.domain.models.ui.*
import com.tangem.feature.swap.domain.models.DataError
import com.tangem.feature.swap.domain.models.SwapAmount
import com.tangem.feature.swap.domain.models.domain.*
import com.tangem.feature.swap.domain.models.formatToUIRepresentation
import com.tangem.feature.swap.domain.models.ui.*
import com.tangem.feature.swap.models.*
import com.tangem.feature.swap.models.states.*
import com.tangem.feature.swap.presentation.R
@ -651,9 +651,17 @@ internal class StateBuilder(
}
fun loadingPermissionState(uiState: SwapStateHolder): SwapStateHolder {
val warnings = uiState.warnings.filterNot { it is SwapWarning.PermissionNeeded }.toMutableList()
warnings.add(
0,
SwapWarning.TransactionInProgressWarning(
title = resourceReference(R.string.swapping_pending_transaction_title),
description = resourceReference(R.string.swapping_pending_transaction_subtitle),
),
)
return uiState.copy(
permissionState = SwapPermissionState.InProgress,
warnings = uiState.warnings.filterNot { it is SwapWarning.PermissionNeeded },
warnings = warnings,
)
}

View file

@ -560,6 +560,7 @@ internal class SwapViewModel @Inject constructor(
is TxState.TxSent -> {
uiState = stateBuilder.loadingPermissionState(uiState)
uiState = stateBuilder.dismissBottomSheet(uiState)
startLoadingQuotesFromLastState(isSilent = true)
}
is TxState.UserCancelled -> Unit
else -> {