Skip to content

Commit

Permalink
fix/remove_pages
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Jan 27, 2024
1 parent bc654c1 commit 005cfbb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ovos_gui/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def handle_delete_page(self, message: Message):
message_is_valid = _validate_page_message(message)
if message_is_valid:
namespace_name = message.data["__from"]
pages_to_remove = message.data["page"]
pages_to_remove = message.data["page_names"]
with namespace_lock:
self._remove_pages(namespace_name, pages_to_remove)

Expand All @@ -627,8 +627,8 @@ def _remove_pages(self, namespace_name: str, pages_to_remove: List[str]):
namespace = self.loaded_namespaces.get(namespace_name)
if namespace is not None and namespace in self.active_namespaces:
page_positions = []
for index, page in enumerate(pages_to_remove):
if page == namespace.pages[index].id:
for index, page in enumerate(namespace.pages):
if page.name in pages_to_remove:
page_positions.append(index)

page_positions.sort(reverse=True)
Expand Down Expand Up @@ -981,6 +981,7 @@ def handle_namespace_global_back(self, message: Optional[Message]):
Handles global back events from the GUI.
@param message: the event sent by the GUI
"""
# TODO - unused ? missing bus event ?
namespace_name = self.active_namespaces[0].skill_id
namespace = self.loaded_namespaces.get(namespace_name)
if namespace in self.active_namespaces:
Expand Down

0 comments on commit 005cfbb

Please sign in to comment.