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)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user