1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 20:19:23 +00:00

src/apps/management: reset_device with no layout resets homescreen

This commit is contained in:
Pavol Rusnak 2018-03-01 05:02:11 +01:00
parent b77646904b
commit 144e2013bd
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 11 additions and 0 deletions

View File

@ -5,6 +5,7 @@ from trezor.messages import ButtonRequestType, FailureType, wire_types
from trezor.messages.ButtonRequest import ButtonRequest
from trezor.messages.EntropyRequest import EntropyRequest
from trezor.messages.Success import Success
from trezor import workflow
from trezor.pin import pin_to_int
from trezor.ui.confirm import HoldToConfirmDialog
from trezor.ui.mnemonic import MnemonicKeyboard
@ -79,6 +80,9 @@ async def reset_device(ctx, msg):
# show success message
if not msg.skip_backup:
await show_success(ctx)
else:
# trigger reload of homescreen
workflow.restartdefault()
return Success(message='Initialized')

View File

@ -34,6 +34,13 @@ def startdefault(handler):
loop.schedule(default)
def restartdefault():
global default_handler
d = default_handler
closedefault()
startdefault(d)
def onlayoutstart(l):
closedefault()
layouts.append(l)