Skip to content

Commit

Permalink
Fix menu update issue on presenter change (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajm13 authored Nov 30, 2023
1 parent 25c1c37 commit cf1e766
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions plugin/Vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def start(self):

def on_run(self):
self.on_presenter_change()
self.menu.open_folder('.')
self.menu.show_menu()

@async_callback
Expand All @@ -60,13 +59,15 @@ async def on_export_integration(self, request):

@async_callback
async def on_presenter_change(self):
in_account = self.account in self.menu.path
in_org = self.org and self.org in self.menu.path
if in_account or in_org:
self.menu.path = '.'

info = await self.request_presenter_info()
if not info.account_id:
return

in_account = self.account in self.menu.path
in_org = self.org and self.org in self.menu.path

self.account = info.account_id
self.vault.create_path(self.account)

Expand All @@ -79,11 +80,7 @@ async def on_presenter_change(self):
if not self.menu.menu.enabled:
return

if in_account or in_org:
self.menu.path = '.'
self.menu.open_folder('.')
else:
self.menu.update()
self.menu.open_folder('.')

def on_complex_list_changed(self):
self.scene_viewer.on_scene_changed()
Expand Down
2 changes: 1 addition & 1 deletion plugin/menus/VaultMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def show_menu(self):
else:
self.lbl_instr.text_value = f'Visit {self.address} in browser to add files'

self.update()
self.open_folder('.')
self.menu.enabled = True
self.plugin.update_menu(self.menu)

Expand Down

0 comments on commit cf1e766

Please sign in to comment.