Browse Source

qt/qrreader(zbar): don't call callback if user closes camera window

- without this, in send tab paytoedit, try_payment_identifier will get called and it will error
df1b9a223c/electrum/gui/qt/paytoedit.py (L153)
- also, in all text fields this used to result in clearing the current text (but now it is kept instead)
master
SomberNight 2 years ago
parent
commit
d89f9846b9
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 3
      electrum/gui/qt/qrreader/__init__.py
  2. 2
      electrum/gui/qt/util.py

3
electrum/gui/qt/qrreader/__init__.py

@ -105,6 +105,9 @@ def _scan_qrcode_using_zbar(
else:
success = True
error = ""
if data is None:
# probably user cancelled
success = False
callback(success, error, data)

2
electrum/gui/qt/util.py

@ -672,7 +672,7 @@ class GenericInputHandler:
) -> None:
if setText is None:
setText = self.setText
def cb(success: bool, error: str, data):
def cb(success: bool, error: str, data: Optional[str]):
if not success:
if error:
show_error(error)

Loading…
Cancel
Save