Skip to content

Commit ea65e68

Browse files
committed
fix: update input even when the amount in invalid to prevent blockers due to low on chain amounts
1 parent a595577 commit ea65e68

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,12 @@ class AppViewModel @Inject constructor(
270270

271271
private fun onAmountChange(value: String) {
272272
val newInput = if (_sendUiState.value.amountInput == "0") value else _sendUiState.value.amountInput + value
273-
val isAmountValid = validateAmount(newInput)
274-
if (isAmountValid) {
275-
_sendUiState.update { it.copy( amountInput = newInput,) }
273+
_sendUiState.update {
274+
it.copy(
275+
amountInput = newInput,
276+
isAmountInputValid = validateAmount(newInput)
277+
)
276278
}
277-
_sendUiState.update { it.copy(isAmountInputValid = isAmountValid,) }
278279
}
279280

280281
private fun onPaymentMethodSwitch() {

0 commit comments

Comments
 (0)