Updated on 2026-08-14

This commit is contained in:
Tangem 2024-01-31 11:10:01 +01:00
parent 443560a5fd
commit ad0c793b00
3 changed files with 7 additions and 5 deletions

View file

@ -320,5 +320,5 @@ internal sealed class AddCustomTokenWarning(val description: TextReference) {
internal data class AddCustomTokenFloatingButton(
val isEnabled: Boolean,
val showProgress: Boolean,
val onClick: () -> Unit
val onClick: () -> Unit,
)

View file

@ -94,7 +94,7 @@ internal object AddCustomTokenPreviewData {
floatingButton = AddCustomTokenFloatingButton(
isEnabled = false,
showProgress = false,
onClick = {}
onClick = {},
),
testBlock = AddCustomTokenTestBlock(
chooseTokenButtonText = "Choose token",
@ -119,7 +119,8 @@ internal object AddCustomTokenPreviewData {
floatingButton = AddCustomTokenFloatingButton(
isEnabled = false,
showProgress = false,
onClick = {}),
onClick = {},
),
)
}
}

View file

@ -145,7 +145,8 @@ internal class AddCustomTokenViewModel @Inject constructor(
return AddCustomTokenFloatingButton(
isEnabled = true,
showProgress = false,
onClick = actionsHandler::onAddCustomTokenClick)
onClick = actionsHandler::onAddCustomTokenClick,
)
}
private inner class FormStateBuilder {
@ -857,7 +858,7 @@ internal class AddCustomTokenViewModel @Inject constructor(
viewModelScope.launch(dispatchers.io) {
val oldButtonState = uiState.floatingButton
uiState = uiState.copySealed(
floatingButton = uiState.floatingButton.copy(isEnabled = false, showProgress = true)
floatingButton = uiState.floatingButton.copy(isEnabled = false, showProgress = true),
)
runCatching { featureInteractor.saveToken(currency) }
.onSuccess { featureRouter.openWalletScreen() }