Fix BT/WiFi run-state health and BT Locate tracking continuity

This commit is contained in:
Smittix
2026-02-19 21:39:09 +00:00
parent 9e634ffbd8
commit 7c816e3543
6 changed files with 256 additions and 144 deletions
+4 -1
View File
@@ -3910,7 +3910,10 @@
const btScanActive = (typeof BluetoothMode !== 'undefined' &&
typeof BluetoothMode.isScanning === 'function' &&
BluetoothMode.isScanning()) || isBtRunning;
if (btScanActive && typeof stopBtScan === 'function') stopBtScan();
const isBtModeTransition =
(currentMode === 'bluetooth' && mode === 'bt_locate') ||
(currentMode === 'bt_locate' && mode === 'bluetooth');
if (btScanActive && !isBtModeTransition && typeof stopBtScan === 'function') stopBtScan();
if (isAprsRunning) stopAprs();
if (isTscmRunning) stopTscmSweep();
}