Skip to content

Commit

Permalink
Correct platform lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronClaydon authored Oct 21, 2024
1 parent 03eb245 commit 15894af
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/views/Journeys/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,10 @@ export default {
let platform = element.OriginPlatform
let platformType = 'ESTIMATED'
if (journey.RealtimeJourney?.Stops?.[element.OriginStopRef]?.Platform !== ""
&& journey.RealtimeJourney?.Stops?.[element.OriginStopRef]?.Platform !== undefined) {
platform = journey.RealtimeJourney?.Stops?.[element.OriginStopRef]?.Platform
let realtimeStop = this.getRealtimeForStop(journey.RealtimeJourney?.Stops, element.OriginStop)
if (realtimeStop?.Platform !== "" && realtimeStop?.Platform !== undefined) {
platform = realtimeStop?.Platform
platformType = 'ACTUAL'
}
Expand All @@ -562,7 +563,7 @@ export default {
departureTime: element.OriginDepartureTime,
activity: element.OriginActivity,
track: track,
realtime: this.getRealtimeForStop(journey.RealtimeJourney?.Stops, element.OriginStop),
realtime: realtimeStop,
platform: platform,
platformType: platformType,
})
Expand All @@ -574,8 +575,10 @@ export default {
let platform = element.DestinationPlatform
let platformType = 'ESTIMATED'
if (journey.RealtimeJourney?.Stops?.[element.DestinationStopRef]?.Platform !== "") {
platform = journey.RealtimeJourney?.Stops?.[element.DestinationStopRef]?.Platform
let realtimeStop = this.getRealtimeForStop(journey.RealtimeJourney?.Stops, element.DestinationStop)
if (realtimeStop?.Platform !== "") {
platform = realtimeStop?.Platform
platformType = 'ACTUAL'
}
// TODO this is a little hack?
Expand All @@ -596,7 +599,7 @@ export default {
departureTime: destinationArrivalTime,
activity: element.DestinationActivity,
track: null,
realtime: this.getRealtimeForStop(journey.RealtimeJourney?.Stops, element.DestinationStop),
realtime: realtimeStop,
platform: platform,
platformType: platformType,
lastOne: true
Expand Down Expand Up @@ -665,4 +668,4 @@ export default {
clearInterval(this.serviceAlertsRefreshTimer)
},
};
</script>
</script>

0 comments on commit 15894af

Please sign in to comment.