Skip to content

Commit

Permalink
Fix distance calculation for moving journey.
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sneh-s committed Jan 17, 2025
1 parent f7ed458 commit 38a0d01
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fun getJourney(
val updatedJourney = lastKnownJourney.copy(
to_latitude = newLocation.latitude,
to_longitude = newLocation.longitude,
route_distance = distance,
route_distance = (lastKnownJourney.route_distance ?: 0.0) + distance,
route_duration = lastKnownJourney.updated_at -
lastKnownJourney.created_at,
routes = lastKnownJourney.routes + newLocation.toRoute()
Expand Down

0 comments on commit 38a0d01

Please sign in to comment.