qml: don't enable save button for already saved invoices

This commit is contained in:
Sander van Grieken
2023-12-21 13:29:37 +01:00
parent bec74304b6
commit cb34bbee7e

View File

@@ -337,14 +337,17 @@ class QEInvoice(QObject, QtEventListener):
self.canPay = False
self.canSave = False
if self.invoiceType == QEInvoice.Type.Invalid:
return
if not self.amountOverride.isEmpty:
amount = self.amountOverride
else:
amount = self.amount
self.canSave = True
self.canSave = not bool(self._wallet.wallet.get_invoice(self._effectiveInvoice.get_id()))
if amount.isEmpty and self.status == PR_UNPAID: # unspecified amount
if amount.isEmpty and self.status == PR_UNPAID: # unspecified amount
return
if self.invoiceType == QEInvoice.Type.LightningInvoice: