From 68cafe8cd0df6b9c2cb4c1b43869658aa2c6ec97 Mon Sep 17 00:00:00 2001 From: James Smith Date: Thu, 21 May 2026 17:47:42 +0100 Subject: [PATCH] fix: move applyViewState calls after output display override in switchMode switchMode() forces output.style.display='block' for modes not in modesWithVisuals (line ~4906). Our applyViewState calls were placed before this line, so the override undid the dashboard hide. Moving them after ensures SensorDashboard can correctly hide #output in dashboard mode. Co-Authored-By: Claude Sonnet 4.6 --- templates/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/index.html b/templates/index.html index 56580b7..6055ad4 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4813,8 +4813,6 @@ document.getElementById('pagerStats')?.classList.toggle('active', mode === 'pager'); document.getElementById('sensorStats')?.classList.toggle('active', mode === 'sensor'); - if (typeof PagerDirectory !== 'undefined') PagerDirectory.applyViewState(mode); - if (typeof SensorDashboard !== 'undefined') SensorDashboard.applyViewState(mode); document.getElementById('satelliteStats')?.classList.toggle('active', mode === 'satellite'); document.getElementById('wifiStats')?.classList.toggle('active', mode === 'wifi'); @@ -4904,6 +4902,8 @@ const outputEl = document.getElementById('output'); const modesWithVisuals = ['satellite', 'sstv', 'weathersat', 'sstv_general', 'wefax', 'aprs', 'wifi', 'bluetooth', 'tscm', 'spystations', 'meshtastic', 'meshcore', 'websdr', 'subghz', 'spaceweather', 'bt_locate', 'wifi_locate', 'waterfall', 'morse', 'meteor', 'system', 'ook', 'radiosonde', 'gps', 'drone']; if (outputEl) outputEl.style.display = modesWithVisuals.includes(mode) ? 'none' : 'block'; + if (typeof PagerDirectory !== 'undefined') PagerDirectory.applyViewState(mode); + if (typeof SensorDashboard !== 'undefined') SensorDashboard.applyViewState(mode); // Prevent Leaflet heatmap redraws on hidden BT Locate map containers. if (typeof BtLocate !== 'undefined' && BtLocate.setActiveMode) {