Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-20 14:59:32 +03:00
parent b775329fb3
commit 20efecd9ee
13 changed files with 49 additions and 19 deletions

View file

@ -2048,6 +2048,7 @@ internal class SwapModel @Inject constructor(
uiState = uiState.copy(
swapButton = uiState.swapButton.copy(
isEnabled = false,
isInProgress = false,
),
)
modelScope.launch {

View file

@ -78,6 +78,7 @@ sealed class SwapCardState {
data class SwapButton(
@DrawableRes val walletInteractionIcon: Int?,
val isEnabled: Boolean,
val isInProgress: Boolean = false,
val onClick: () -> Unit,
)

View file

@ -608,6 +608,7 @@ internal class StateBuilder(
return uiState.copy(
swapButton = uiState.swapButton.copy(
isEnabled = false,
isInProgress = true,
),
)
}
@ -811,6 +812,7 @@ internal class StateBuilder(
return uiState.copy(
swapButton = uiState.swapButton.copy(
isEnabled = false,
isInProgress = false,
),
permissionState = GiveTxPermissionState.InProgress,
notifications = notificationsFactory.getApprovalInProgressStateNotification(uiState.notifications),

View file

@ -380,7 +380,11 @@ private fun MainButton(state: SwapStateHolder) {
} else {
PrimaryButtonIconEnd(
modifier = Modifier.fillMaxWidth(),
text = stringResourceSafe(id = R.string.swapping_swap_action),
text = if (state.swapButton.isInProgress) {
stringResourceSafe(id = R.string.swapping_swap_action_in_progress)
} else {
stringResourceSafe(id = R.string.swapping_swap_action)
},
iconResId = state.swapButton.walletInteractionIcon,
enabled = state.swapButton.isEnabled,
onClick = state.swapButton.onClick,