|
|
@ -54,7 +54,6 @@ const tokenSend: string = useSelector(state => state.userReducer.userFladToken);
|
|
|
|
const locationresp = await Location.getCurrentPositionAsync({});
|
|
|
|
const locationresp = await Location.getCurrentPositionAsync({});
|
|
|
|
// send location to server
|
|
|
|
// send location to server
|
|
|
|
if(currentMusic){
|
|
|
|
if(currentMusic){
|
|
|
|
|
|
|
|
|
|
|
|
const body: Record<string, string | boolean | number | (string | boolean | number)[]> = {
|
|
|
|
const body: Record<string, string | boolean | number | (string | boolean | number)[]> = {
|
|
|
|
longitude: locationresp.coords.longitude,
|
|
|
|
longitude: locationresp.coords.longitude,
|
|
|
|
latitude: locationresp.coords.latitude,
|
|
|
|
latitude: locationresp.coords.latitude,
|
|
|
@ -91,7 +90,7 @@ const tokenSend: string = useSelector(state => state.userReducer.userFladToken);
|
|
|
|
console.log(error);
|
|
|
|
console.log(error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const interval = setInterval(sendLocationUpdate, 5000);
|
|
|
|
const interval = setInterval(sendLocationUpdate, 30000);
|
|
|
|
return () => {
|
|
|
|
return () => {
|
|
|
|
clearInterval(interval);
|
|
|
|
clearInterval(interval);
|
|
|
|
};
|
|
|
|
};
|
|
|
|