1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-18 03:10:58 +00:00

fix(core): disallow canceling on uncancelable pages

This commit is contained in:
Ioan Bizău 2025-01-15 15:58:44 +01:00 committed by Ioan Bizău
parent d711fbcad5
commit dd3bf253f8
3 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1 @@
[T3B1] Fix backup failing if middle button is pressed during confirmation.

View File

@ -489,7 +489,11 @@ impl Component for ButtonController {
} else { } else {
( (
ButtonState::OneReleased(b), ButtonState::OneReleased(b),
Some(ButtonControllerMsg::Triggered(b.into(), false)), match b {
PhysicalButton::Left => self.left_btn.maybe_trigger(ctx),
PhysicalButton::Right => self.right_btn.maybe_trigger(ctx),
_ => None,
},
) )
} }
} }

View File

@ -179,9 +179,11 @@ where
// Clicked BACK. Scroll up. // Clicked BACK. Scroll up.
self.go_to_previous_page(); self.go_to_previous_page();
self.change_page(ctx); self.change_page(ctx);
} else { } else if self.cancel_btn_details.is_some() {
// Clicked CANCEL. Send result. // Clicked CANCEL. Send result.
return Some(PageMsg::Cancelled); return Some(PageMsg::Cancelled);
} else {
return None;
} }
} }
ButtonPos::Right => { ButtonPos::Right => {