Skip to content

Commit

Permalink
SFT-2121: allowed recovery from root directory, only if a backup is
Browse files Browse the repository at this point in the history
present
  • Loading branch information
mjg-foundation committed Jun 21, 2023
1 parent 5ce3eea commit 9968843
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ports/stm32/boards/Passport/modules/flows/restore_backup_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,18 @@ async def check_if_erased(self):
self.goto(self.choose_file)

async def choose_file(self):
result = await FilePickerFlow(suffix='.7z', show_folders=True).run()
from utils import get_file_list, get_backups_folder_path

suffix = '.7z'
files = get_file_list(suffix=suffix)
if len(files) == 0:
initial_path = get_backups_folder_path()
else:
initial_path = None

result = await FilePickerFlow(initial_path=initial_path,
suffix=suffix,
show_folders=True).run()
if result is None:
# No file chosen, so go back to menu
self.set_result(False)
Expand Down

0 comments on commit 9968843

Please sign in to comment.