1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-21 22:08:08 +00:00

fix(core/homescreen): properly redraw when an outside process kills homescreen

This happens with FIDO which does not use the normal workflow management
and so `workflow.close_others()` is never called.
This commit is contained in:
matejcik 2021-04-21 13:07:07 +02:00 committed by matejcik
parent 411a7bb802
commit 959cf7d515

View File

@ -16,6 +16,15 @@ class HomescreenBase(ui.Layout):
"apps/homescreen/res/bg.toif"
)
async def __iter__(self) -> ui.ResultValue:
# We need to catch the ui.Cancelled exception that kills us, because that means
# that we will need to draw on screen again after restart.
try:
return await super().__iter__()
except ui.Cancelled:
storage.cache.homescreen_shown = None
raise
def on_render(self) -> None:
if not self.repaint:
return