Skip to content
Snippets Groups Projects
Commit fea39c46 authored by dos's avatar dos Committed by ave
Browse files

py,st3m: Application: Check transition direction

...instead of reaching for private parts.
parent 9abf8d5a
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ from st3m.ui.view import ( ...@@ -2,6 +2,7 @@ from st3m.ui.view import (
BaseView, BaseView,
ViewTransitionSwipeLeft, ViewTransitionSwipeLeft,
ViewManager, ViewManager,
ViewTransitionDirection,
) )
from st3m.ui.menu import MenuItem from st3m.ui.menu import MenuItem
from st3m.input import InputState from st3m.input import InputState
...@@ -67,9 +68,7 @@ class Application(BaseView): ...@@ -67,9 +68,7 @@ class Application(BaseView):
super().on_enter(vm) super().on_enter(vm)
def on_exit(self) -> None: def on_exit(self) -> None:
fully_exiting = not self.vm._history or not isinstance( fully_exiting = self.vm.direction == ViewTransitionDirection.BACKWARD
self.vm._history[-1], type(self)
)
# If the app requested to change wifi state # If the app requested to change wifi state
# fall back to system defaults on exit # fall back to system defaults on exit
if fully_exiting and self._wifi_preference is not None: if fully_exiting and self._wifi_preference is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment