kivy: do not open invoices, requests dialogs if list is empty
This commit is contained in:
@@ -837,12 +837,22 @@ class ElectrumWindow(App):
|
||||
|
||||
def invoices_dialog(self, screen):
|
||||
from .uix.dialogs.invoices import InvoicesDialog
|
||||
if len(self.wallet.invoices.sorted_list()) == 0:
|
||||
self.show_info(' '.join([
|
||||
_('No saved invoices.'),
|
||||
_('Signed invoices are saved automatically when you scan them.'),
|
||||
_('You may also save unsigned requests or contact addresses using the save button.')
|
||||
]))
|
||||
return
|
||||
popup = InvoicesDialog(self, screen, None)
|
||||
popup.update()
|
||||
popup.open()
|
||||
|
||||
def requests_dialog(self, screen):
|
||||
from .uix.dialogs.requests import RequestsDialog
|
||||
if len(self.wallet.get_sorted_requests(self.electrum_config)) == 0:
|
||||
self.show_info(_('No saved requests.'))
|
||||
return
|
||||
popup = RequestsDialog(self, screen, None)
|
||||
popup.update()
|
||||
popup.open()
|
||||
|
||||
Reference in New Issue
Block a user