From 5f76dc714a4bc0412d765b3d18b84040c64e9a77 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Mon, 5 Feb 2018 11:47:27 +0100 Subject: [PATCH] apps/management/reset_device: fix display clear, move pin request --- src/apps/management/reset_device.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apps/management/reset_device.py b/src/apps/management/reset_device.py index 5731c2651b..779e6bdfa4 100644 --- a/src/apps/management/reset_device.py +++ b/src/apps/management/reset_device.py @@ -37,17 +37,17 @@ async def reset_device(ctx, msg): FailureType.UnexpectedMessage, 'Already initialized') - # generate and display internal entropy - internal_entropy = random.bytes(32) - if msg.display_random: - await show_entropy(ctx, internal_entropy) - # request new PIN if msg.pin_protection: newpin = await request_pin_confirm(ctx) else: newpin = '' + # generate and display internal entropy + internal_entropy = random.bytes(32) + if msg.display_random: + await show_entropy(ctx, internal_entropy) + # request external entropy and compute mnemonic ext_ack = await ctx.call(EntropyRequest(), wire_types.EntropyAck) mnemonic = generate_mnemonic( @@ -160,11 +160,11 @@ async def show_mnemonic_page(page: int, page_count: int, pages: list): lines = ['%d. %s' % (wi + 1, word) for wi, word in pages[page]] content = Text('Recovery seed', ui.ICON_RESET, ui.MONO, *lines) content = Scrollpage(content, page, page_count) + ui.display.clear() if page + 1 == page_count: await HoldToConfirmDialog(content) else: - ui.display.clear() content.render() await animate_swipe()