mirror of
https://github.com/smittix/intercept.git
synced 2026-05-01 10:09:59 -07:00
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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user