File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
app/src/main/java/to/bitkit/viewmodels Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -598,6 +598,19 @@ class AppViewModel @Inject constructor(
598598 }
599599
600600 val lnurl = _sendUiState .value.lnurl
601+ if (lnurl is LnurlParams .LnurlPay ) {
602+ val minSendable = lnurl.data.minSendableSat()
603+ if (_sendUiState .value.amount < minSendable) {
604+ toast(
605+ type = Toast .ToastType .ERROR ,
606+ title = context.getString(R .string.wallet__lnurl_pay__error_min__title),
607+ description = context.getString(R .string.wallet__lnurl_pay__error_min__description)
608+ .replace(" {amount}" , minSendable.toString()),
609+ testTag = " LnurlPayAmountTooLowToast" ,
610+ )
611+ return
612+ }
613+ }
601614 if (lnurl is LnurlParams .LnurlWithdraw ) {
602615 setSendEffect(SendEffect .NavigateToWithdrawConfirm )
603616 return
@@ -630,10 +643,9 @@ class AppViewModel @Inject constructor(
630643 null -> lightningRepo.canSend(amount)
631644 is LnurlParams .LnurlWithdraw -> amount < lnurl.data.maxWithdrawableSat()
632645 is LnurlParams .LnurlPay -> {
633- val minSat = lnurl.data.minSendableSat()
634646 val maxSat = lnurl.data.maxSendableSat()
635647
636- amount in minSat .. maxSat && lightningRepo.canSend(amount)
648+ amount <= maxSat && lightningRepo.canSend(amount)
637649 }
638650 }
639651
You can’t perform that action at this time.
0 commit comments