Skip to content

Commit

Permalink
Merge pull request #92 from Reveille-Rides/bwees/dedup-estimates
Browse files Browse the repository at this point in the history
dedup estimates based on scheduled arrival time
  • Loading branch information
bwees authored Jan 12, 2024
2 parents f516f4f + 9e3d205 commit 76ad921
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/components/sheets/RouteDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ const RouteDetails: React.FC<SheetProps> = ({ 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 (
Expand Down

0 comments on commit 76ad921

Please sign in to comment.