1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-18 19:31:04 +00:00

fix(core): use the filtered event for subsequent processing

That way we won't pass raw touch events to underlying component if that
touch is already part of a swipe.
This commit is contained in:
matejcik 2024-11-25 15:18:04 +01:00 committed by matejcik
parent 997c27adb3
commit b9fb9ce243

View File

@ -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()
@ -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)));
}