Skip to content

Commit

Permalink
fix(core): disallow canceling on uncancelable pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ibz committed Jan 15, 2025
1 parent 8207b9f commit 5a898c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/.changelog.d/4500.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[T3B1] Fix backup failing if middle button is pressed during confirmation.
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,11 @@ impl Component for ButtonController {
} else {
(
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,
},
)
}
}
Expand Down
4 changes: 3 additions & 1 deletion core/embed/rust/src/ui/layout_samson/component/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ where
// Clicked BACK. Scroll up.
self.go_to_previous_page();
self.change_page(ctx);
} else {
} else if self.cancel_btn_details.is_some() {
// Clicked CANCEL. Send result.
return Some(PageMsg::Cancelled);
} else {
return None;
}
}
ButtonPos::Right => {
Expand Down

0 comments on commit 5a898c5

Please sign in to comment.