Browse Source

invoices and requests: rm 3 seconds delay

patch-4
ThomasV 4 years ago
parent
commit
94708f63e4
  1. 13
      electrum/gui/kivy/main_window.py
  2. 12
      electrum/gui/qt/main_window.py

13
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()

12
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)

Loading…
Cancel
Save