Skip to content

Commit

Permalink
feat: suppression lodash.round
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlr committed Jan 15, 2025
1 parent 49b813b commit e89621c
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Box, Flex, Image, Text } from "@chakra-ui/react"
import distance from "@turf/distance"
import { round } from "lodash"
import { useRouter } from "next/router"
import React, { useContext, useEffect } from "react"

Expand Down Expand Up @@ -167,8 +166,7 @@ const ChoiceColumn = ({

const updateTrainingDistanceWithNewCenter = (coordinates) => {
for (let i = 0; i < trainings.length; ++i) {
//const trainingCoords = [trainings[i].place.longitude, trainings[i].place.latitude];
trainings[i].place.distance = round(distance(coordinates, [trainings[i].place.longitude, trainings[i].place.latitude]), 2)
trainings[i].place.distance = Math.round(distance(coordinates, [trainings[i].place.longitude, trainings[i].place.latitude]) * 100) / 100
}
setTrainings(trainings)
}
Expand Down

0 comments on commit e89621c

Please sign in to comment.