Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-06 01:37:16 -07:00
parent 7b6fc18a8f
commit 14ac9e6f30
2 changed files with 3 additions and 2 deletions

View file

@ -113,7 +113,7 @@ internal class TangemPayCardLimitSetupModel @Inject constructor(
}
private fun onAmountChange(newValue: String) {
if (newValue.toBigDecimalOrNull() == null) return
if (newValue.isNotEmpty() && newValue.toBigDecimalOrNull() == null) return
uiState.update { state ->
state.copy(
amountFieldModel = state.amountFieldModel.copy(value = newValue),

View file

@ -101,6 +101,7 @@ internal class TangemPayCardLimitSetupModelTest {
) {
val model = createModel()
model.uiState.value.amountFieldModel.onValueChange("100")
model.uiState.value.amountFieldModel.onValueChange(amount)
assertThat(model.uiState.value.isSubmitButtonEnabled).isEqualTo(expectedEnabled)
@ -149,7 +150,7 @@ internal class TangemPayCardLimitSetupModelTest {
Arguments.of("100", true),
Arguments.of("-1", false),
Arguments.of("", false),
Arguments.of("abc", false),
Arguments.of("abc", true),
Arguments.of("1001", false),
)
}