Remove courses that have reached their destination
This commit is contained in:
parent
ef8d88de28
commit
ff84c7c93b
|
@ -286,6 +286,13 @@ const updateData = async courses => {
|
||||||
courses[id] = newCourse;
|
courses[id] = newCourse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove stale courses
|
||||||
|
for (const id of Object.keys(courses)) {
|
||||||
|
if (courses[id].departureStop === courses[id].finalStop) {
|
||||||
|
delete courses[id];
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const tick = (courses, time) => {
|
const tick = (courses, time) => {
|
||||||
|
|
Loading…
Reference in New Issue