Skip to content

Commit

Permalink
invoices and requests: rm 3 seconds delay
Browse files Browse the repository at this point in the history
  • Loading branch information
ecdsa committed Jan 12, 2021
1 parent a2122a8 commit 94708f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
13 changes: 9 additions & 4 deletions electrum/gui/kivy/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@ def on_request_status(self, event, wallet, key, status):
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:
Expand All @@ -258,9 +260,12 @@ def on_invoice_status(self, event, wallet, key):
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()
Expand Down
12 changes: 2 additions & 10 deletions electrum/gui/qt/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,12 +1520,8 @@ def on_request_status(self, wallet, key, status):
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)
Expand All @@ -1537,12 +1533,8 @@ def on_invoice_status(self, wallet, key):
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)
Expand Down

0 comments on commit 94708f6

Please sign in to comment.