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

fix(core): TS3 device freeze

[no changelog]
This commit is contained in:
obrusvit 2024-06-06 11:58:24 +02:00 committed by matejcik
parent 5a8989f00d
commit b560ce53c0
3 changed files with 17 additions and 16 deletions

View File

@ -224,11 +224,17 @@ class RustLayout(LayoutParentType[T]):
else:
def create_tasks(self) -> tuple[loop.AwaitableTask, ...]:
if context.CURRENT_CONTEXT:
return (
self.handle_timers(),
self.handle_input_and_rendering(),
self.handle_usb(context.get_context()),
)
else:
return (
self.handle_timers(),
self.handle_input_and_rendering(),
)
def _first_paint(self) -> None:
self._paint()

View File

@ -21,8 +21,6 @@ async def request_word_count(recovery_type: RecoveryType) -> int:
async def request_word(
word_index: int, word_count: int, is_slip39: bool, prefill_word: str = ""
) -> str:
from trezor.wire.context import wait
prompt = TR.recovery__word_x_of_y_template.format(word_index + 1, word_count)
can_go_back = word_index > 0
@ -40,7 +38,7 @@ async def request_word(
)
)
word: str = await wait(word_choice)
word: str = await word_choice
return word

View File

@ -74,7 +74,6 @@ async def select_word(
group_index: int | None = None,
) -> str:
from trezor.strings import format_ordinal
from trezor.wire.context import wait
# It may happen (with a very low probability)
# that there will be less than three unique words to choose from.
@ -84,15 +83,13 @@ async def select_word(
words.append(words[-1])
word_ordinal = format_ordinal(checked_index + 1)
result = await wait(
RustLayout(
result = await RustLayout(
trezorui2.select_word(
title="",
description=TR.reset__select_word_template.format(word_ordinal),
words=(words[0].lower(), words[1].lower(), words[2].lower()),
)
)
)
if __debug__ and isinstance(result, str):
return result
assert isinstance(result, int) and 0 <= result <= 2