From b0c323bb89fbacf76f59f545c39090fa3e75fb1a Mon Sep 17 00:00:00 2001 From: Smittix Date: Fri, 30 Jan 2026 09:50:10 +0000 Subject: [PATCH] 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 --- templates/index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/templates/index.html b/templates/index.html index 6097b45..6f97ed2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -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