From d7c8a1592ea098f91811ea3ad7451cc08223cd6a Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 3 Jun 2022 21:23:43 +0200 Subject: [PATCH] the invoice/request key issue is annoying --- electrum/gui/qml/qeinvoicelistmodel.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/electrum/gui/qml/qeinvoicelistmodel.py b/electrum/gui/qml/qeinvoicelistmodel.py index 8fa464e9c..ea97ae9bf 100644 --- a/electrum/gui/qml/qeinvoicelistmodel.py +++ b/electrum/gui/qml/qeinvoicelistmodel.py @@ -99,7 +99,7 @@ class QEAbstractInvoiceListModel(QAbstractListModel): def invoice_to_model(self, invoice: Invoice): item = self.get_invoice_as_dict(invoice) - item['key'] = invoice.get_id() + #item['key'] = invoice.get_id() item['is_lightning'] = invoice.is_lightning() if invoice.is_lightning() and 'address' not in item: item['address'] = '' @@ -132,6 +132,7 @@ class QEInvoiceListModel(QEAbstractInvoiceListModel): def invoice_to_model(self, invoice: Invoice): item = super().invoice_to_model(invoice) item['type'] = 'invoice' + item['key'] = invoice.get_id() return item @@ -150,9 +151,10 @@ class QERequestListModel(QEAbstractInvoiceListModel): _logger = get_logger(__name__) - def invoice_to_model(self, req: Invoice): - item = super().invoice_to_model(req) + def invoice_to_model(self, invoice: Invoice): + item = super().invoice_to_model(invoice) item['type'] = 'request' + item['key'] = invoice.get_id() if invoice.is_lightning() else invoice.get_address() return item @@ -162,8 +164,8 @@ class QERequestListModel(QEAbstractInvoiceListModel): def get_invoice_for_key(self, key: str): return self.wallet.get_request(key) - def get_invoice_as_dict(self, req: Invoice): - return self.wallet.export_request(req) + def get_invoice_as_dict(self, invoice: Invoice): + return self.wallet.export_request(invoice) @pyqtSlot(str, int) def updateRequest(self, key, status):