Fix duplicate audioContext declaration breaking disclaimer popup

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 <noreply@anthropic.com>
This commit is contained in:
James Smith
2025-12-30 18:19:40 +00:00
parent 0f248ed0ee
commit bc32bb5cda
+6 -7
View File
@@ -3832,19 +3832,18 @@
let alertedAircraft = {}; // Track aircraft that have already triggered alerts let alertedAircraft = {}; // Track aircraft that have already triggered alerts
let adsbAlertsEnabled = true; // Toggle for audio alerts let adsbAlertsEnabled = true; // Toggle for audio alerts
// Audio alert system using Web Audio API // Audio alert system using Web Audio API (uses shared audioContext declared later)
let audioContext = null; function getAdsbAudioContext() {
function getAudioContext() { if (!window.adsbAudioCtx) {
if (!audioContext) { window.adsbAudioCtx = new (window.AudioContext || window.webkitAudioContext)();
audioContext = new (window.AudioContext || window.webkitAudioContext)();
} }
return audioContext; return window.adsbAudioCtx;
} }
function playAlertSound(type) { function playAlertSound(type) {
if (!adsbAlertsEnabled) return; if (!adsbAlertsEnabled) return;
try { try {
const ctx = getAudioContext(); const ctx = getAdsbAudioContext();
const oscillator = ctx.createOscillator(); const oscillator = ctx.createOscillator();
const gainNode = ctx.createGain(); const gainNode = ctx.createGain();