Fix a bug with mock GPX traces and delay

`Date.parse` returns milliseconds timestamp, not a `Date` object.
This commit is contained in:
Lucas Verney 2018-08-29 18:57:55 +02:00
parent f0fc8f287d
commit 168f1b122c

View File

@ -60,8 +60,8 @@ export function mockLocationWithGPX(index, setPosition) {
setPosition(mockGPX[index]);
if (mockGPX[index + 1]) {
const delay = (
Date.parse(mockGPX[index + 1].time).getTime()
- Date.parse(mockGPX[index].time).getTime()
Date.parse(mockGPX[index + 1].time)
- Date.parse(mockGPX[index].time)
);
setTimeout(
() => mockLocationWithGPX(index + 1, setPosition),