Skip to content

Commit

Permalink
fix: close_application now actually closes the passed application
Browse files Browse the repository at this point in the history
  • Loading branch information
sassanh committed Feb 14, 2024
1 parent bc4d55e commit 5f3c06a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 0.9.3

- fix: close_application now actually closes the passed application

## Version 0.9.2

- fix: queue transitions instead of letting the last transition interrupt the active
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ubo-gui"
version = "0.9.2"
version = "0.9.3"
description = "GUI sdk for Ubo Pod"
authors = ["Sassan Haradji <[email protected]>"]
license = "Apache-2.0"
Expand Down
8 changes: 5 additions & 3 deletions ubo_gui/menu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,11 @@ def clean_application(self: MenuWidget, application: PageWidget) -> None:
def close_application(self: MenuWidget, application: PageWidget) -> None:
"""Close an application after its `on_close` event is fired."""
self.clean_application(application)
if application in self.stack:
while application in self.stack:
self.go_back()
while any(
isinstance(item, StackApplicationItem) and item.application is application
for item in self.stack
):
self.go_back()

@property
def top(self: MenuWidget) -> StackItem:
Expand Down

0 comments on commit 5f3c06a

Please sign in to comment.