commit 94708f63e4f237f5f4c143137de797f9c0ccc08e
parent a2122a8c19579a2dc3d91f0d41633c9d4d129988
Author: ThomasV <thomasv@electrum.org>
Date: Tue, 12 Jan 2021 10:48:43 +0100
invoices and requests: rm 3 seconds delay
Diffstat:
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/electrum/gui/kivy/main_window.py b/electrum/gui/kivy/main_window.py
@@ -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()
diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
@@ -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)