qml: show insufficient balance text for lightning invoice without fallback and insufficient ln send capacity
This commit is contained in:
@@ -63,7 +63,9 @@ ElDialog {
|
|||||||
: invoice.status == Invoice.Paid
|
: invoice.status == Invoice.Paid
|
||||||
? InfoTextArea.IconStyle.Done
|
? InfoTextArea.IconStyle.Done
|
||||||
: invoice.status == Invoice.Unpaid && invoice.expiration > 0
|
: invoice.status == Invoice.Unpaid && invoice.expiration > 0
|
||||||
? InfoTextArea.IconStyle.Pending
|
? invoice.canPay
|
||||||
|
? InfoTextArea.IconStyle.Pending
|
||||||
|
: InfoTextArea.IconStyle.Error
|
||||||
: InfoTextArea.IconStyle.Info
|
: InfoTextArea.IconStyle.Info
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -327,9 +327,8 @@ class QEInvoice(QObject, QtEventListener):
|
|||||||
lnaddr = self._effectiveInvoice._lnaddr
|
lnaddr = self._effectiveInvoice._lnaddr
|
||||||
if lnaddr.amount and amount.satsInt < lnaddr.amount * COIN:
|
if lnaddr.amount and amount.satsInt < lnaddr.amount * COIN:
|
||||||
self.userinfo = _('Cannot pay less than the amount specified in the invoice')
|
self.userinfo = _('Cannot pay less than the amount specified in the invoice')
|
||||||
elif self.address and self.get_max_spendable_onchain() < amount.satsInt:
|
elif not self.address or self.get_max_spendable_onchain() < amount.satsInt:
|
||||||
# TODO: validate address?
|
# TODO: for onchain: validate address? subtract fee?
|
||||||
# TODO: subtract fee?
|
|
||||||
self.userinfo = _('Insufficient balance')
|
self.userinfo = _('Insufficient balance')
|
||||||
else:
|
else:
|
||||||
self.userinfo = userinfo_for_invoice_status(self.status)
|
self.userinfo = userinfo_for_invoice_status(self.status)
|
||||||
|
|||||||
Reference in New Issue
Block a user