1
0

kivy GUI: show better error message if we cannot channel backup import because lightning is disabled or unavailable. fixes #7899

This commit is contained in:
ThomasV
2022-07-21 09:11:55 +02:00
parent b5617ec0fd
commit 3afee67ea3

View File

@@ -1452,6 +1452,14 @@ class ElectrumWindow(App, Logger, EventListener):
self.protected(_("Decrypt your private key?"), show_private_key, (addr, pk_label))
def import_channel_backup(self, encrypted):
if not self.wallet.has_lightning():
msg = _('Cannot import channel backup.')
if self.wallet.can_have_lightning():
msg += ' ' + _('Lightning is not enabled.')
else:
msg += ' ' + _('Lightning is not available for this wallet.')
self.show_error(msg)
return
d = Question(_('Import Channel Backup?'), lambda b: self._import_channel_backup(b, encrypted))
d.open()