From 203b66f6ed84d83ad37935806e2b34bde8449c94 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 13 Dec 2023 12:06:36 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/feature/swap/ui/StateBuilder.kt | 14 +++++++++++--- .../feature/swap/viewmodels/SwapViewModel.kt | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt index 6f674f14e9..18933ba236 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt @@ -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, ) } 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 944e9ff75d..a36badc51e 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 @@ -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 -> {