diff --git a/routes/bluetooth_v2.py b/routes/bluetooth_v2.py index d1fd306..8878539 100644 --- a/routes/bluetooth_v2.py +++ b/routes/bluetooth_v2.py @@ -261,7 +261,7 @@ def start_scan(): # Check if already scanning if scanner.is_scanning: return jsonify({ - 'status': 'already_running', + 'status': 'already_scanning', 'scan_status': scanner.get_status().to_dict() }) diff --git a/static/js/modes/bluetooth.js b/static/js/modes/bluetooth.js index f432e98..a7b62f1 100644 --- a/static/js/modes/bluetooth.js +++ b/static/js/modes/bluetooth.js @@ -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'; } })(); diff --git a/templates/index.html b/templates/index.html index 92a459a..adce6a3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4296,6 +4296,10 @@ const sensorTimelineContainer = document.getElementById('sensorTimelineContainer'); if (pagerTimelineContainer) pagerTimelineContainer.style.display = mode === 'pager' ? 'block' : 'none'; if (sensorTimelineContainer) sensorTimelineContainer.style.display = mode === 'sensor' ? 'block' : 'none'; + const pagerScopePanel = document.getElementById('pagerScopePanel'); + if (pagerScopePanel && mode !== 'pager') pagerScopePanel.style.display = 'none'; + const sensorScopePanel = document.getElementById('sensorScopePanel'); + if (sensorScopePanel && mode !== 'sensor') sensorScopePanel.style.display = 'none'; const morseScopePanel = document.getElementById('morseScopePanel'); const morseOutputPanel = document.getElementById('morseOutputPanel'); if (morseScopePanel && mode !== 'morse') morseScopePanel.style.display = 'none';