mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2025-07-05 03:44:09 +08:00
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:
parent
7b9d05f84b
commit
00928ac947
2 changed files with 106 additions and 53 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue