mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-08 07:18:47 +00:00
feat: show seed fingerprint on each screen
This commit is contained in:
28
src/main.py
28
src/main.py
@@ -20,7 +20,13 @@ from nostr.client import NostrClient
|
||||
from password_manager.entry_types import EntryType
|
||||
from constants import INACTIVITY_TIMEOUT, initialize_app
|
||||
from utils.password_prompt import PasswordPromptError
|
||||
from utils import timed_input, copy_to_clipboard, clear_screen, pause
|
||||
from utils import (
|
||||
timed_input,
|
||||
copy_to_clipboard,
|
||||
clear_screen,
|
||||
pause,
|
||||
clear_and_print_fingerprint,
|
||||
)
|
||||
from local_bip85.bip85 import Bip85Error
|
||||
|
||||
|
||||
@@ -571,7 +577,9 @@ def handle_toggle_secret_mode(pm: PasswordManager) -> None:
|
||||
def handle_profiles_menu(password_manager: PasswordManager) -> None:
|
||||
"""Submenu for managing seed profiles."""
|
||||
while True:
|
||||
clear_screen()
|
||||
clear_and_print_fingerprint(
|
||||
getattr(password_manager, "current_fingerprint", None)
|
||||
)
|
||||
print(color_text("\nProfiles:", "menu"))
|
||||
print(color_text("1. Switch Seed Profile", "menu"))
|
||||
print(color_text("2. Add a New Seed Profile", "menu"))
|
||||
@@ -607,7 +615,9 @@ def handle_nostr_menu(password_manager: PasswordManager) -> None:
|
||||
return
|
||||
|
||||
while True:
|
||||
clear_screen()
|
||||
clear_and_print_fingerprint(
|
||||
getattr(password_manager, "current_fingerprint", None)
|
||||
)
|
||||
print(color_text("\nNostr Settings:", "menu"))
|
||||
print(color_text("1. Backup to Nostr", "menu"))
|
||||
print(color_text("2. Restore from Nostr", "menu"))
|
||||
@@ -641,7 +651,9 @@ def handle_nostr_menu(password_manager: PasswordManager) -> None:
|
||||
def handle_settings(password_manager: PasswordManager) -> None:
|
||||
"""Interactive settings menu with submenus for profiles and Nostr."""
|
||||
while True:
|
||||
clear_screen()
|
||||
clear_and_print_fingerprint(
|
||||
getattr(password_manager, "current_fingerprint", None)
|
||||
)
|
||||
print(color_text("\nSettings:", "menu"))
|
||||
print(color_text("1. Profiles", "menu"))
|
||||
print(color_text("2. Nostr", "menu"))
|
||||
@@ -733,7 +745,9 @@ def display_menu(
|
||||
display_fn()
|
||||
pause()
|
||||
while True:
|
||||
clear_screen()
|
||||
clear_and_print_fingerprint(
|
||||
getattr(password_manager, "current_fingerprint", None)
|
||||
)
|
||||
if time.time() - password_manager.last_activity > inactivity_timeout:
|
||||
print(colored("Session timed out. Vault locked.", "yellow"))
|
||||
password_manager.lock_vault()
|
||||
@@ -805,7 +819,9 @@ def display_menu(
|
||||
elif choice == "2":
|
||||
password_manager.update_activity()
|
||||
password_manager.handle_retrieve_entry()
|
||||
clear_screen()
|
||||
clear_and_print_fingerprint(
|
||||
getattr(password_manager, "current_fingerprint", None)
|
||||
)
|
||||
elif choice == "3":
|
||||
password_manager.update_activity()
|
||||
password_manager.handle_search_entries()
|
||||
|
Reference in New Issue
Block a user