fix: bluetooth no results, audio waveform leak, and mode switch cleanup

- Change 'already_running' to 'already_scanning' status in bluetooth_v2
  so frontend recognizes the response and connects the SSE stream
- Hide pagerScopePanel and sensorScopePanel in switchMode() to prevent
  audio waveform bars leaking into other modes
- Clear devices Map, pendingDeviceIds Set, and UI in BluetoothMode.destroy()
  to prevent memory accumulation on repeated mode switches

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-28 17:16:55 +00:00
parent 05edfb93dc
commit 10e4804e0a
3 changed files with 12 additions and 1 deletions

View File

@@ -1784,6 +1784,13 @@ const BluetoothMode = (function() {
*/
function destroy() {
stopEventStream();
devices.clear();
pendingDeviceIds.clear();
if (deviceContainer) {
deviceContainer.innerHTML = '';
}
const countEl = document.getElementById('btDeviceListCount');
if (countEl) countEl.textContent = '0';
}
})();