From 818d879126b05c4316dae202f3a7ea1c5a9be630 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 31 Jul 2024 03:37:55 -0700 Subject: [PATCH] Fix typeguards for station state again Fixes #209 --- src/interfaces/messages.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/interfaces/messages.ts b/src/interfaces/messages.ts index e5891cb..cba72b0 100644 --- a/src/interfaces/messages.ts +++ b/src/interfaces/messages.ts @@ -210,8 +210,9 @@ export function isStationStateUpdateAvailable( ): message is StationStateUpdateAvailable { return ( message.type === "kStationStateUpdate" && - message.value.isAvailable !== undefined && - message.value.isAvailable + // This is for backwards compatibility with older versions of TrackAudio + // that do not include the isAvailable property. + (message.value.isAvailable === undefined || message.value.isAvailable) ); }