Skip to content

Commit 6233f03

Browse files
authored
Merge pull request #503 from HSLdevcom/trains-with-platforms-fix
Fix: Trains with platforms
2 parents a3195de + 1c293d9 commit 6233f03

2 files changed

Lines changed: 21 additions & 10 deletions

File tree

src/monitorConfig.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ export default {
111111
alert: '#dc0451',
112112
monitorButtonBackground: 'rgba(255, 255, 255, 0.7)',
113113
},
114+
modeIcons: {
115+
colors: {
116+
'mode-rail': '#000000',
117+
},
118+
postfix: '',
119+
setName: 'digitransit',
120+
},
114121
},
115122
tampere: {
116123
colors: {

src/ui/TrainDataFetcher.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,20 @@ const TrainDataFetcher: FC<IProps> = ({
161161
? stopAndRoutes.find(el => el.routes.match(/\d+$/)?.[0] === id)
162162
?.routes
163163
: train.commuterLineid;
164-
trainsWithTrack.push({
165-
lineId: line,
166-
trainNumber: train.trainNumber,
167-
time: formattedDateTimeFromSeconds(
168-
utcToSeconds(train.timeTableRows[idx].scheduledTime),
169-
'yyyy-MM-dd HH:mm:ss',
170-
),
171-
timeInSecs: utcToSeconds(train.timeTableRows[idx].scheduledTime),
172-
track: train.timeTableRows[idx].commercialTrack,
173-
});
164+
if (train.timeTableRows[idx]) {
165+
trainsWithTrack.push({
166+
lineId: line,
167+
trainNumber: train.trainNumber,
168+
time: formattedDateTimeFromSeconds(
169+
utcToSeconds(train.timeTableRows[idx].scheduledTime),
170+
'yyyy-MM-dd HH:mm:ss',
171+
),
172+
timeInSecs: utcToSeconds(
173+
train.timeTableRows[idx].scheduledTime,
174+
),
175+
track: train.timeTableRows[idx].commercialTrack,
176+
});
177+
}
174178
}
175179
});
176180
});

0 commit comments

Comments
 (0)