Skip to content

Commit

Permalink
fix(core): use the filtered event for subsequent processing
Browse files Browse the repository at this point in the history
That way we won't pass raw touch events to underlying component if that
touch is already part of a swipe.
  • Loading branch information
matejcik committed Nov 25, 2024
1 parent 997c27a commit b9fb9ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/embed/rust/src/ui/flow/swipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl SwipeFlow {

let mut attach = false;

let e = if self.allow_swipe {
let event = if self.allow_swipe {
let page = self.current_page();
let config = page
.get_swipe_config()
Expand Down Expand Up @@ -251,12 +251,12 @@ impl SwipeFlow {

match decision {
Decision::Nothing => {
decision = self.handle_event_child(ctx, e);
decision = self.handle_event_child(ctx, event);

// when doing internal transition, pass attach event to the child after sending
// swipe end.
if attach {
if let Event::Swipe(SwipeEvent::End(dir)) = e {
if let Event::Swipe(SwipeEvent::End(dir)) = event {
self.current_page_mut()
.event(ctx, Event::Attach(AttachType::Swipe(dir)));
}
Expand Down

0 comments on commit b9fb9ce

Please sign in to comment.