Skip to content

Commit

Permalink
Fix typeguards for station state again
Browse files Browse the repository at this point in the history
Fixes #209
  • Loading branch information
neilenns committed Jul 31, 2024
1 parent 4f08ab9 commit 818d879
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/interfaces/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
}

Expand Down

0 comments on commit 818d879

Please sign in to comment.