diff --git a/app/components/sheets/RouteDetails.tsx b/app/components/sheets/RouteDetails.tsx index 8b6aa29..65b90f2 100644 --- a/app/components/sheets/RouteDetails.tsx +++ b/app/components/sheets/RouteDetails.tsx @@ -167,6 +167,12 @@ const RouteDetails: React.FC = ({ sheetRef }) => { if (tempDirectionTimes) { directionTimes = tempDirectionTimes; } + + // remove duplicate nextDeparts if there are any scheduledDepartTimeUtc duplicates + directionTimes.nextDeparts = directionTimes.nextDeparts.filter((value, index, self) => { + return self.findIndex((time) => time.scheduledDepartTimeUtc === value.scheduledDepartTimeUtc) === index; + }); + } return (