Skip to content

Commit

Permalink
file_manager: Check tag before querying current path (talonhub#1442)
Browse files Browse the repository at this point in the history
Also bugfix the clearing of the current page numbers.
  • Loading branch information
auscompgeek committed Jul 6, 2024
1 parent 3d5e77d commit fb243a2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tags/file_manager/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def gui_files(gui: imgui.GUI):


def clear_lists():
global folder_selections, file_selections
global folder_selections, file_selections, current_folder_page, current_file_page
if (
len(ctx.lists["self.file_manager_directories"]) > 0
or len(ctx.lists["self.file_manager_files"]) > 0
Expand Down Expand Up @@ -398,12 +398,15 @@ def win_event_handler(window):
if not window.app.exe or window != ui.active_window():
return

path = actions.user.file_manager_current_path()

if "user.file_manager" not in registry.tags:
actions.user.file_manager_hide_pickers()
clear_lists()
elif path:
cached_path = None
return

path = actions.user.file_manager_current_path()

if path:
if cached_path != path:
update_lists(path)
elif cached_path:
Expand Down

0 comments on commit fb243a2

Please sign in to comment.