From cb34bbee7e380080eeea0d19bca34fdde16940d7 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Thu, 21 Dec 2023 13:29:37 +0100 Subject: [PATCH] qml: don't enable save button for already saved invoices --- electrum/gui/qml/qeinvoice.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qml/qeinvoice.py b/electrum/gui/qml/qeinvoice.py index 700c65f3d..5c8794869 100644 --- a/electrum/gui/qml/qeinvoice.py +++ b/electrum/gui/qml/qeinvoice.py @@ -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: