diff --git a/selfdrive/ui/mici/widgets/dialog.py b/selfdrive/ui/mici/widgets/dialog.py index 26845765c3..b11056f993 100644 --- a/selfdrive/ui/mici/widgets/dialog.py +++ b/selfdrive/ui/mici/widgets/dialog.py @@ -40,11 +40,6 @@ class BigDialogBase(NavWidget, abc.ABC): # move to right side self._right_btn._rect.x = self._rect.x + self._rect.width - self._right_btn._rect.width - def hide_event(self): - # Free reference to self to allow refcount to go to zero - super().hide_event() - self.set_back_callback(None) - def _render(self, _) -> DialogResult: """ Allows `gui_app.set_modal_overlay(BigDialog(...))`. @@ -168,11 +163,6 @@ class BigInputDialog(BigDialogBase): confirm_callback(self._keyboard.text()) self._confirm_callback = confirm_callback_wrapper - def hide_event(self): - # Free reference to self to allow refcount to go to zero - super().hide_event() - self._confirm_callback = None - def _update_state(self): super()._update_state() diff --git a/system/ui/widgets/__init__.py b/system/ui/widgets/__init__.py index efa35bc016..546c682f33 100644 --- a/system/ui/widgets/__init__.py +++ b/system/ui/widgets/__init__.py @@ -252,7 +252,7 @@ class NavWidget(Widget, abc.ABC): def set_back_enabled(self, enabled: bool | Callable[[], bool]) -> None: self._back_enabled = enabled - def set_back_callback(self, callback: Callable[[], None] | None) -> None: + def set_back_callback(self, callback: Callable[[], None]) -> None: self._back_callback = callback def _handle_mouse_event(self, mouse_event: MouseEvent) -> None: