Skip to content

Commit

Permalink
fix stopname for last leg
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharma-xyz committed Oct 21, 2024
1 parent d5126f5 commit a2ca9e8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fun JourneyDetailCard(
.height(8.dp)
)

legList.forEach { leg ->
legList.forEachIndexed { index, leg ->
if (leg.walkInterchange?.position == TimeTableState.JourneyCardInfo.WalkPosition.BEFORE) {
leg.walkInterchange?.duration?.let { duration ->
WalkingLeg(
Expand Down Expand Up @@ -171,8 +171,8 @@ fun JourneyDetailCard(
JourneyLeg(
transportModeLine = leg.transportModeLine,
stopsInfo = leg.stopsInfo,
departureTime = leg.stops.first().time,
stopName = leg.stops.first().name,
departureTime = if (index == legList.lastIndex) leg.stops.last().time else leg.stops.first().time,
stopName = if (index == legList.lastIndex) leg.stops.last().name else leg.stops.first().name,
isWheelchairAccessible = false,
modifier = Modifier.padding(start = 8.dp, end = 8.dp),
)
Expand Down

0 comments on commit a2ca9e8

Please sign in to comment.