mirror of
https://github.com/smittix/intercept.git
synced 2026-07-23 08:28:11 -07:00
Fix false emergency alerts and ACARS compatibility
- Fix emergency alerts triggering for non-emergency squawk codes (VFR 1200/7000, etc.) by checking squawkInfo.type === 'emergency' before alerting - Fix emergency filter to only show actual emergency squawk codes - Add acarsdec version detection to support both -j (newer) and -o 4 (older) JSON flags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -540,7 +540,7 @@
|
||||
const squawkInfo = checkSquawkCode(ac);
|
||||
const onWatchlist = isOnWatchlist(ac);
|
||||
|
||||
if (squawkInfo) {
|
||||
if (squawkInfo && squawkInfo.type === 'emergency') {
|
||||
alertedAircraft[icao] = 'emergency';
|
||||
playAlertSound('emergency');
|
||||
showAlertBanner(`EMERGENCY: ${squawkInfo.name} - ${ac.callsign || icao}`, '#ff0000');
|
||||
@@ -1905,7 +1905,7 @@ ACARS: ${r.statistics.acarsMessages} messages`;
|
||||
const squawkInfo = checkSquawkCode(ac);
|
||||
if (currentFilter === 'military') return militaryInfo.military;
|
||||
if (currentFilter === 'civil') return !militaryInfo.military;
|
||||
if (currentFilter === 'emergency') return !!squawkInfo;
|
||||
if (currentFilter === 'emergency') return squawkInfo && squawkInfo.type === 'emergency';
|
||||
if (currentFilter === 'watchlist') return isOnWatchlist(ac);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user