Skip to content

Commit

Permalink
fix: use original origin/destination when the train is cancelled at a…
Browse files Browse the repository at this point in the history
… station
  • Loading branch information
davwheat committed Jun 16, 2024
1 parent b247380 commit 62db6c6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/api/ProcessServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,16 @@ export function processServices(
});

return new Service({
destinations: (service.currentDestinations || service.destination).map((d) => ({ name: d.locationName, via: d.via, crs: d.crs })),
origins: (service.currentOrigins || service.origin).map((o) => ({ name: o.locationName, via: o.via, crs: o.crs })),
destinations: (service.isCancelled ? service.destination : service.currentDestinations || service.destination).map((d) => ({
name: d.locationName,
via: d.via,
crs: d.crs,
})),
origins: (service.isCancelled ? service.origin : service.currentOrigins || service.origin).map((o) => ({
name: o.locationName,
via: o.via,
crs: o.crs,
})),

cancelled: service.isCancelled,

Expand Down

0 comments on commit 62db6c6

Please sign in to comment.