We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0bd765 commit 8ba3a0eCopy full SHA for 8ba3a0e
apps/state/lib/state/trip/added.ex
@@ -55,10 +55,11 @@ defmodule State.Trip.Added do
55
defp prediction_to_trip({trip_id, prediction}) do
56
with %{route_pattern_id: route_pattern_id} when is_binary(route_pattern_id) <- prediction,
57
%{representative_trip_id: rep_trip_id} <- State.RoutePattern.by_id(route_pattern_id),
58
- [trip | _] <- State.Trip.by_id(rep_trip_id) do
+ [trip | _] <- State.Trip.by_id(rep_trip_id),
59
+ %Route{} = route <- State.Route.by_id(prediction.route_id) do
60
stop = parent_or_stop(prediction.stop_id)
61
- headsign = if stop && subway?(trip.route_type), do: stop.name, else: trip.headsign
62
+ headsign = if stop && subway?(route), do: stop.name, else: trip.headsign
63
64
[
65
%{
0 commit comments