fix: Handle mode URL parameter on index page load

- Read ?mode=X parameter from URL when index.html loads
- Automatically switch to the specified mode (e.g., /?mode=aprs)
- Fixes navigation from dashboard pages to panel modes like APRS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-30 09:50:10 +00:00
parent 425572ac87
commit b0c323bb89
+11
View File
@@ -2420,6 +2420,17 @@
// Initialize dropdown nav active state
updateDropdownActiveState();
// Handle mode parameter from URL (e.g., /?mode=aprs)
const urlParams = new URLSearchParams(window.location.search);
const modeParam = urlParams.get('mode');
if (modeParam && typeof switchMode === 'function') {
// Valid modes that can be switched to
const validModes = ['pager', 'sensor', 'rtlamr', 'satellite', 'sstv', 'wifi', 'bluetooth', 'listening', 'aprs', 'tscm', 'spystations', 'meshtastic'];
if (validModes.includes(modeParam)) {
switchMode(modeParam);
}
}
});
// Toggle section collapse