Fix: avoid negative numbers in the UI.

This commit is contained in:
Kevin Gorham 2020-03-26 09:43:28 -04:00
parent 436fa5fa74
commit dcd1e63491
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
1 changed files with 2 additions and 2 deletions

View File

@ -150,8 +150,8 @@ class SendAddressFragment : BaseFragment<FragmentSendAddressBinding>(),
private fun onBalanceUpdated(balance: WalletBalance) {
binding.textLayoutAmount.helperText =
"You have ${balance.availableZatoshi.convertZatoshiToZecString(8)} available"
maxZatoshi = balance.availableZatoshi - ZcashSdk.MINERS_FEE_ZATOSHI
"You have ${balance.availableZatoshi.coerceAtLeast(0L).convertZatoshiToZecString(8)} available"
maxZatoshi = (balance.availableZatoshi - ZcashSdk.MINERS_FEE_ZATOSHI).coerceAtLeast(0L)
}
override fun onPrimaryClipChanged() {