Skip to content

Commit

Permalink
fix apple watch multidirection
Browse files Browse the repository at this point in the history
  • Loading branch information
bwees committed Sep 24, 2024
1 parent 1cc2487 commit 212b070
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions targets/watch/RouteDetail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,17 @@ struct RouteDetail: View {

if (patternPaths.count > 0 && (error == nil)) {
Divider()
ForEach(selectedPath!.patternPoints, id: \.key) { point in
ForEach(Array(selectedPath!.patternPoints.enumerated()), id: \.element.key) { i, point in
if (point.stop != nil) {
StopCell(stop: point.stop!, direction: route.directionList[selectedDirection].direction, route: route)
StopCell(
stop: point.stop!,
// if we are the last element and there is another direction, use that direction for estimate
// this fixed the "no departure times" that the last element on multidirection route would always have
direction: route.directionList.count > 1 && i == selectedPath!.patternPoints.count-1
? route.directionList[selectedDirection == 0 ? 1 : 0].direction
: route.directionList[selectedDirection].direction,
route: route
)
}
}
.listStyle(.plain)
Expand Down

0 comments on commit 212b070

Please sign in to comment.