diff --git a/python_payload/st3m/application.py b/python_payload/st3m/application.py index 4621d725af20f9d14e03a821b510ec05215bdb16..285f23b69e3a148f9d1660a67a867741674e55c7 100644 --- a/python_payload/st3m/application.py +++ b/python_payload/st3m/application.py @@ -59,9 +59,12 @@ class Application(BaseView): super().on_enter(vm) def on_exit(self) -> None: + fully_exiting = not self.vm._history or not isinstance( + self.vm._history[-1], type(self) + ) # If the app requested to change wifi state # fall back to system defaults on exit - if self._wifi_preference is not None: + if fully_exiting and self._wifi_preference is not None: st3m.wifi._onoff_wifi_update() super().on_exit()