From 4cf2fa9fe5a9ffa196a502d79d7a231114c6212e Mon Sep 17 00:00:00 2001 From: James Smith Date: Tue, 30 Dec 2025 18:19:40 +0000 Subject: [PATCH] Fix duplicate audioContext declaration breaking disclaimer popup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renamed ADS-B audio context to avoid conflict with existing audio system. The duplicate 'let audioContext' declaration was causing a JavaScript syntax error that prevented the rest of the script from loading, including the acceptDisclaimer function. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- templates/index.html | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/templates/index.html b/templates/index.html index 75fd61b..8187b91 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3832,19 +3832,18 @@ let alertedAircraft = {}; // Track aircraft that have already triggered alerts let adsbAlertsEnabled = true; // Toggle for audio alerts - // Audio alert system using Web Audio API - let audioContext = null; - function getAudioContext() { - if (!audioContext) { - audioContext = new (window.AudioContext || window.webkitAudioContext)(); + // Audio alert system using Web Audio API (uses shared audioContext declared later) + function getAdsbAudioContext() { + if (!window.adsbAudioCtx) { + window.adsbAudioCtx = new (window.AudioContext || window.webkitAudioContext)(); } - return audioContext; + return window.adsbAudioCtx; } function playAlertSound(type) { if (!adsbAlertsEnabled) return; try { - const ctx = getAudioContext(); + const ctx = getAdsbAudioContext(); const oscillator = ctx.createOscillator(); const gainNode = ctx.createGain();