mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-24 14:20:57 +00:00
src/apps/fido_u2f: add layout handling
This commit is contained in:
parent
c568071177
commit
af53d39c44
@ -456,16 +456,27 @@ class ConfirmState:
|
|||||||
|
|
||||||
def kill(self) -> None:
|
def kill(self) -> None:
|
||||||
if self.task is not None:
|
if self.task is not None:
|
||||||
workflow.onclose(self.task)
|
|
||||||
loop.close(self.task)
|
loop.close(self.task)
|
||||||
self.task = None
|
self.task = None
|
||||||
|
|
||||||
async def confirm(self) -> None:
|
async def confirm(self) -> None:
|
||||||
|
confirmed = False
|
||||||
|
try:
|
||||||
|
confirmed = await self.confirm_layout()
|
||||||
|
finally:
|
||||||
|
self.confirmed = confirmed
|
||||||
|
workflow.onclose(self.task)
|
||||||
|
|
||||||
|
@ui.layout
|
||||||
|
async def confirm_layout(self) -> None:
|
||||||
from trezor.ui.confirm import HoldToConfirmDialog
|
from trezor.ui.confirm import HoldToConfirmDialog
|
||||||
|
|
||||||
content = ConfirmContent(self.action, self.app_id)
|
content = ConfirmContent(self.action, self.app_id)
|
||||||
dialog = HoldToConfirmDialog(content)
|
dialog = HoldToConfirmDialog(content)
|
||||||
ui.display.clear()
|
ui.display.clear()
|
||||||
self.confirmed = await dialog
|
|
||||||
|
return await dialog
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_state = None # type: Optional[ConfirmState] # state for msg_register and msg_authenticate
|
_state = None # type: Optional[ConfirmState] # state for msg_register and msg_authenticate
|
||||||
|
Loading…
Reference in New Issue
Block a user