Updated on 2026-08-14
This commit is contained in:
parent
b775329fb3
commit
20efecd9ee
13 changed files with 49 additions and 19 deletions
|
|
@ -2048,6 +2048,7 @@ internal class SwapModel @Inject constructor(
|
|||
uiState = uiState.copy(
|
||||
swapButton = uiState.swapButton.copy(
|
||||
isEnabled = false,
|
||||
isInProgress = false,
|
||||
),
|
||||
)
|
||||
modelScope.launch {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ sealed class SwapCardState {
|
|||
data class SwapButton(
|
||||
@DrawableRes val walletInteractionIcon: Int?,
|
||||
val isEnabled: Boolean,
|
||||
val isInProgress: Boolean = false,
|
||||
val onClick: () -> Unit,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue