Fixed and made changes to the Haversine distance formula calculation. We now point it to the user's location as intended

This commit is contained in:
Keannu Christian Bernasol 2023-09-11 19:02:11 +08:00
parent 7b9d05f84b
commit 00928ac947
2 changed files with 106 additions and 53 deletions

View file

@ -193,8 +193,13 @@ export default function Home() {
return data;
},
onSuccess: (data: StudentStatusListReturnType) => {
if (data[1]) {
setStudyGroups(ParseStudentStatusList(data[1]));
if (data[1] && location) {
setStudyGroups(
ParseStudentStatusList(data[1], {
latitude: location.coords.latitude,
longitude: location.coords.longitude,
})
);
}
},
onError: (error: Error) => {