Browse Source

payment_identifier: check if payment identifier is usable and enable/disable Send/Pay buttons

master
Sander van Grieken 2 years ago
parent
commit
ae8c4f1281
  1. 7
      electrum/gui/qt/send_tab.py

7
electrum/gui/qt/send_tab.py

@ -426,8 +426,11 @@ class SendTab(QWidget, MessageBoxMixin, Logger):
else: else:
self.amount_e.setToolTip('') self.amount_e.setToolTip('')
self.send_button.setEnabled(bool(self.amount_e.get_amount()) and not pi.has_expired() and not pi.is_error()) pi_unusable = pi.is_error() or (not self.wallet.has_lightning() and not pi.is_onchain())
self.save_button.setEnabled(not pi.is_error() and pi.type not in [PaymentIdentifierType.LNURLP, PaymentIdentifierType.LNADDR])
self.send_button.setEnabled(not pi_unusable and bool(self.amount_e.get_amount()) and not pi.has_expired())
self.save_button.setEnabled(not pi_unusable and pi.type not in [PaymentIdentifierType.LNURLP,
PaymentIdentifierType.LNADDR])
def _handle_payment_identifier(self): def _handle_payment_identifier(self):
self.update_fields() self.update_fields()

Loading…
Cancel
Save