Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
timeDiff = (new Date().getTime() - timeStart) / 1000;
this._interval = setInterval(() => {
this.setState({ runningDuration: this.state.runningDuration + 1 })
}, 1000);
break;
case "paused":
timeDiff = (new Date(runState.pauseAt).getTime() - timeStart) / 1000;
break;
case "finished":
timeDiff = (new Date(runState.finishAt).getTime() - timeStart) / 1000;
break;
}
const distance = await BackgroundGeolocation.getOdometer();
const locations = await BackgroundGeolocation.getLocations();
let coordinates = [];
let markers = [...this.state.markers];
if (locations.length) {
_.forEach(locations, (item) => {
coordinates.push({ latitude: item.coords.latitude, longitude: item.coords.longitude })
})
markers = [{
key: locations[0].uuid,
title: locations[0].timestamp,
heading: locations[0].coords.heading,
coordinate: {
latitude: locations[0].coords.latitude,
longitude: locations[0].coords.longitude
}
}]
}