Skip to content

Commit

Permalink
Merge pull request #165 from canopas/fix-distance-calculation-for-mov…
Browse files Browse the repository at this point in the history
…ing-journey

Fix distance calculation for moving journey
  • Loading branch information
cp-sneh-s authored Jan 22, 2025
2 parents f7ed458 + 38a0d01 commit d849720
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 d849720

Please sign in to comment.