From 03e2807dfc8306e462426d15d5b506f70841c6a1 Mon Sep 17 00:00:00 2001 From: Jean Do Date: Tue, 16 Jul 2024 16:48:29 -0400 Subject: [PATCH] Some menu items reverted to return status None --- src/krux/pages/__init__.py | 16 ++++++---------- src/krux/pages/home_pages/home.py | 2 +- src/krux/pages/home_pages/sign_message_ui.py | 4 ++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/krux/pages/__init__.py b/src/krux/pages/__init__.py index 8a9d362d..f4a065cf 100644 --- a/src/krux/pages/__init__.py +++ b/src/krux/pages/__init__.py @@ -109,7 +109,7 @@ def load_method(self): t("Load from SD card"), None if not self.has_sd_card() else lambda: None, ), - ("< " + t("Back"), lambda: MENU_EXIT), + ("< " + t("Back"), lambda: None), ], ) index, _ = load_menu.run_loop() @@ -902,15 +902,11 @@ def choose_len_mnemonic(ctx): submenu = Menu( ctx, [ - (t("12 words"), lambda: MENU_EXIT), - (t("24 words"), lambda: MENU_EXIT), - ("< " + t("Back"), lambda: MENU_EXIT), + (t("12 words"), lambda: 12), + (t("24 words"), lambda: 24), + ("< " + t("Back"), lambda: None), ], ) - index, _ = submenu.run_loop() + _, num_words = submenu.run_loop() ctx.display.clear() - if index == 0: - return 12 - if index == 1: - return 24 - return None + return num_words diff --git a/src/krux/pages/home_pages/home.py b/src/krux/pages/home_pages/home.py index 0520b49f..a3ebb34f 100644 --- a/src/krux/pages/home_pages/home.py +++ b/src/krux/pages/home_pages/home.py @@ -228,7 +228,7 @@ def _sign_menu(self): t("Sign to SD card"), None if not self.has_sd_card() else lambda: None, ), - ("< " + t("Back"), lambda: MENU_EXIT), + ("< " + t("Back"), lambda: None), ], ) index, _ = sign_menu.run_loop() diff --git a/src/krux/pages/home_pages/sign_message_ui.py b/src/krux/pages/home_pages/sign_message_ui.py index 52c1e7e8..e2645aca 100644 --- a/src/krux/pages/home_pages/sign_message_ui.py +++ b/src/krux/pages/home_pages/sign_message_ui.py @@ -24,7 +24,7 @@ from embit import bip32, compact import hashlib import binascii -from .. import MENU_CONTINUE, MENU_EXIT, LOAD_FROM_CAMERA, LOAD_FROM_SD, Menu +from .. import MENU_CONTINUE, LOAD_FROM_CAMERA, LOAD_FROM_SD, Menu from ...themes import theme from ...display import ( DEFAULT_PADDING, @@ -199,7 +199,7 @@ def sign_message(self): t("Sign to SD card"), None if not self.has_sd_card() else lambda: None, ), - ("< " + t("Back"), lambda: MENU_EXIT), + ("< " + t("Back"), lambda: None), ], ) index, _ = sign_menu.run_loop()