mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 12:00:59 +00:00
chore(core): remove duplicated FlowMsg conversion
[no changelog]
This commit is contained in:
parent
598039434c
commit
8d1a9bc17f
@ -605,7 +605,11 @@ impl TryFrom<FlowMsg> for crate::micropython::obj::Obj {
|
|||||||
FlowMsg::Choice(i) => {
|
FlowMsg::Choice(i) => {
|
||||||
Ok((crate::ui::layout::result::CONFIRMED.as_obj(), i.try_into()?).try_into()?)
|
Ok((crate::ui::layout::result::CONFIRMED.as_obj(), i.try_into()?).try_into()?)
|
||||||
}
|
}
|
||||||
FlowMsg::Text(_s) => panic!(),
|
FlowMsg::Text(s) => Ok((
|
||||||
|
crate::ui::layout::result::CONFIRMED.as_obj(),
|
||||||
|
s.as_str().try_into()?,
|
||||||
|
)
|
||||||
|
.try_into()?),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -357,17 +357,7 @@ impl ObjComponent for SwipeFlow {
|
|||||||
fn obj_event(&mut self, ctx: &mut EventCtx, event: Event) -> Result<Obj, Error> {
|
fn obj_event(&mut self, ctx: &mut EventCtx, event: Event) -> Result<Obj, Error> {
|
||||||
match self.event(ctx, event) {
|
match self.event(ctx, event) {
|
||||||
None => Ok(Obj::const_none()),
|
None => Ok(Obj::const_none()),
|
||||||
Some(FlowMsg::Confirmed) => Ok(crate::ui::layout::result::CONFIRMED.as_obj()),
|
Some(msg) => msg.try_into(),
|
||||||
Some(FlowMsg::Cancelled) => Ok(crate::ui::layout::result::CANCELLED.as_obj()),
|
|
||||||
Some(FlowMsg::Info) => Ok(crate::ui::layout::result::INFO.as_obj()),
|
|
||||||
Some(FlowMsg::Choice(i)) => {
|
|
||||||
Ok((crate::ui::layout::result::CONFIRMED.as_obj(), i.try_into()?).try_into()?)
|
|
||||||
}
|
|
||||||
Some(FlowMsg::Text(s)) => Ok((
|
|
||||||
crate::ui::layout::result::CONFIRMED.as_obj(),
|
|
||||||
s.as_str().try_into()?,
|
|
||||||
)
|
|
||||||
.try_into()?),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user