1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-08 06:20:56 +00:00

fix(core): fix cancel behavior in SignMessage

This commit is contained in:
matejcik 2024-09-20 12:03:37 +02:00 committed by M1nd3r
parent 6d48bbd2aa
commit eb8045ffb8

View File

@ -997,23 +997,24 @@ async def confirm_signverify(
) )
while True: while True:
result = await with_info( try:
address_layout, info_layout, br_name, br_code=BR_CODE_OTHER await with_info(address_layout, info_layout, br_name, br_code=BR_CODE_OTHER)
) except ActionCancelled:
if result is not CONFIRMED:
result = await interact( result = await interact(
trezorui2.show_mismatch(title=TR.addr_mismatch__mismatch), None trezorui2.show_mismatch(title=TR.addr_mismatch__mismatch),
None,
raise_on_cancel=None,
) )
assert result in (CONFIRMED, CANCELLED) assert result in (CONFIRMED, CANCELLED)
# Right button aborts action, left goes back to showing address. # Right button aborts action, left goes back to showing address.
if result is CONFIRMED: if result is CONFIRMED:
raise ActionCancelled raise
continue continue
else:
result = await interact(message_layout, br_name, BR_CODE_OTHER)
if result is CONFIRMED:
break break
await interact(message_layout, br_name, BR_CODE_OTHER)
def error_popup( def error_popup(
title: str, title: str,