From 542dcf3dfa1ac6c9ae1b7bf5ba3e159bb8615a56 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sat, 23 Aug 2025 01:05:39 -0700 Subject: [PATCH] Revert "helper" This reverts commit e237d9a720915fb6bd67c539123d3e2d9d582ce1. --- system/ui/lib/wifi_manager.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/system/ui/lib/wifi_manager.py b/system/ui/lib/wifi_manager.py index 4479ec5950..64621a8afb 100644 --- a/system/ui/lib/wifi_manager.py +++ b/system/ui/lib/wifi_manager.py @@ -52,13 +52,6 @@ def get_security_type(flags: int, wpa_flags: int, rsn_flags: int) -> SecurityTyp return SecurityType.UNSUPPORTED -def run_blocking(func: Callable, block: bool): - if block: - func() - else: - threading.Thread(target=func, daemon=True).start() - - @dataclass(frozen=True) class Network: ssid: str @@ -326,7 +319,11 @@ class WifiManager: if self._forgotten is not None: self._forgotten(ssid) - run_blocking(worker, block) + # TODO: make a helper when it makes sense + if block: + worker() + else: + threading.Thread(target=worker, daemon=True).start() def activate_connection(self, ssid: str, block: bool = False): def worker(): @@ -345,7 +342,11 @@ class WifiManager: # if self._activated is not None: # self._activated() - run_blocking(worker, block) + # TODO: make a helper when it makes sense + if block: + worker() + else: + threading.Thread(target=worker, daemon=True).start() def _request_scan(self): if self._wifi_device is None: