From 21bb13f770c105400ac6e1af0b091415fb8f1672 Mon Sep 17 00:00:00 2001 From: Alexander Harding <2166114+aeharding@users.noreply.github.com> Date: Fri, 24 May 2024 12:28:25 -0500 Subject: [PATCH] Fix sigmet data format change --- src/features/alerts/alertsSlice.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/features/alerts/alertsSlice.ts b/src/features/alerts/alertsSlice.ts index a0124ab..95e4681 100644 --- a/src/features/alerts/alertsSlice.ts +++ b/src/features/alerts/alertsSlice.ts @@ -77,13 +77,21 @@ export function isTFRAlert(alert: Alert): alert is TFRFeature { } export function isSigmetAlert(alert: Alert): alert is SigmetFeature { - return "data" in alert.properties && alert.properties.data === "SIGMET"; + return ( + ("data" in alert.properties && alert.properties.data === "SIGMET") || + ("airSigmetType" in alert.properties && + (alert.properties.airSigmetType === "SIGMET" || + alert.properties.airSigmetType === "OUTLOOK")) + ); } export function isSigmetOutlookAlert( alert: Alert, ): alert is SigmetOutlookFeature { - return isSigmetAlert(alert) && alert.properties.airSigmetType === "OUTLOOK"; + return ( + "airSigmetType" in alert.properties && + alert.properties.airSigmetType === "OUTLOOK" + ); } export function isISigmetAlert(alert: Alert): alert is ISigmetFeature {