1
0

invoices and requests: rm 3 seconds delay

This commit is contained in:
ThomasV
2021-01-12 10:48:43 +01:00
parent a2122a8c19
commit 94708f63e4
2 changed files with 11 additions and 14 deletions

View File

@@ -246,8 +246,10 @@ class ElectrumWindow(App, Logger):
if req is None:
return
if self.receive_screen:
self.receive_screen.update_item(key, req)
Clock.schedule_once(lambda dt: self.receive_screen.update(), 3)
if status == PR_PAID:
self.receive_screen.update()
else:
self.receive_screen.update_item(key, req)
if self.request_popup and self.request_popup.key == key:
self.request_popup.update_status()
if status == PR_PAID:
@@ -258,9 +260,12 @@ class ElectrumWindow(App, Logger):
req = self.wallet.get_invoice(key)
if req is None:
return
status = self.wallet.get_invoice_status(invoice)
if self.send_screen:
self.send_screen.update_item(key, req)
Clock.schedule_once(lambda dt: self.send_screen.update(), 3)
if status == PR_PAID:
self.send_screen.update()
else:
self.send_screen.update_item(key, req)
if self.invoice_popup and self.invoice_popup.key == key:
self.invoice_popup.update_status()

View File

@@ -1520,12 +1520,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
req = self.wallet.receive_requests.get(key)
if req is None:
return
# update item
self.request_list.update_item(key, req)
# update list later
self.timer = QTimer()
self.timer.timeout.connect(self.request_list.update)
self.timer.start(3000)
self.request_list.update()
if status == PR_PAID:
self.notify(_('Payment received') + '\n' + key)
@@ -1537,12 +1533,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
req = self.wallet.get_invoice(key)
if req is None:
return
# update item
self.invoice_list.update_item(key, req)
# update list later.
self.timer = QTimer()
self.timer.timeout.connect(self.invoice_list.update)
self.timer.start(3000)
self.invoice_list.update()
def on_payment_succeeded(self, wallet, key):
description = self.wallet.get_label(key)