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