Skip to content

Commit 760b705

Browse files
committed
AB#288 fix departure typing and check last stop
1 parent 4655f3b commit 760b705

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/test/data/monitor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ export const departure: IDeparture = {
2424
scheduledDeparture: 51763,
2525
serviceDay: 1645480800,
2626
stop: stop,
27+
stops: [stop],
2728
trip: {
2829
tripHeadsign: 'Helsinki',
2930
tripHeadsignfi: 'Helsinki',
3031
tripHeadsignsv: 'Helsingfors',
3132
tripHeadsignen: 'Helsinki',
3233
gtfsId: 'HSL:1234trip',
33-
stops: [stop],
3434
route: { alerts: [], shortName: '123' },
3535
},
3636
};

src/ui/MonitorRow.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ interface ITrip {
2727
tripHeadsignsv: string;
2828
tripHeadsignen: string;
2929
route: IRoute;
30-
stops: Array<IStop>;
3130
gtfsId: string;
3231
}
3332
export interface IDeparture {
@@ -44,6 +43,7 @@ export interface IDeparture {
4443
realtime: boolean;
4544
pickupType: string;
4645
stop: IStop;
46+
stops: Array<IStop>;
4747
combinedPattern?: string;
4848
showStopNumber: boolean;
4949
showVia: boolean;
@@ -193,12 +193,12 @@ const MonitorRow: FC<IProps> = ({
193193
)
194194
: '';
195195
}
196-
/* if (departure.pickupType === 'NONE') {
197-
const lastStop = departure.trip?.stops?.slice(-1).pop().gtfsId;
196+
if (departure.pickupType === 'NONE') {
197+
const lastStop = departure.stops[departure.stops.length - 1].gtfsId;
198198
if (departure.stop.gtfsId === lastStop) {
199-
destination = `${t('endStopArrive')}/${t('endStopTerminus')}`;
199+
destination = `${t('arriveTerminal')}`;
200200
}
201-
} */
201+
}
202202

203203
const line = processLine(departure.trip?.route.shortName);
204204
if (destination?.indexOf(' via') !== -1) {

0 commit comments

Comments
 (0)