mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-17 06:19:25 +08:00
Code cleanup
This commit is contained in:
parent
790574daee
commit
14e14b8bb6
1 changed files with 3 additions and 3 deletions
|
@ -85,7 +85,7 @@ export default function Home() {
|
||||||
newLocation.coords.longitude !== location.coords.longitude
|
newLocation.coords.longitude !== location.coords.longitude
|
||||||
) {
|
) {
|
||||||
setLocation(newLocation);
|
setLocation(newLocation);
|
||||||
GetDistanceRoundedOff(newLocation);
|
DistanceHandler(newLocation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,9 +105,9 @@ export default function Home() {
|
||||||
requestLocation();
|
requestLocation();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
async function GetDistanceRoundedOff(location: RawLocationType) {
|
async function DistanceHandler(location: RawLocationType) {
|
||||||
let dist = GetDistanceFromUSTP(location.coords);
|
let dist = GetDistanceFromUSTP(location.coords);
|
||||||
setDist(Math.round(dist));
|
setDist(dist);
|
||||||
// Deactivate student status if too far away
|
// Deactivate student status if too far away
|
||||||
if (dist >= 2 && !map_debug)
|
if (dist >= 2 && !map_debug)
|
||||||
mutation.mutate({
|
mutation.mutate({
|
||||||
|
|
Loading…
Reference in a new issue