commit 5b8185eb22a588daa5218fcff5fb41c3e4225f3a
parent 4493464b08c7434bcd01867c10eab720e232a88d
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Sat, 9 Nov 2019 19:29:19 +0100
tracks, Movescount: fix handling error responses
name was evaluated after returning response
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/lib/leaflet.control.track-list/lib/services/movescount.js b/src/lib/leaflet.control.track-list/lib/services/movescount.js
@@ -27,12 +27,11 @@ class MovescountRoute extends MovescountBase {
if (response.status === 403) {
return [{error: 'Movescount user disabled viewing this route'}];
}
+ let name = `Movescount route ${this.trackId}`;
const data = response.responseJSON;
if (!data) {
return [{name, error: 'UNSUPPORTED'}];
}
- let name = `Movescount route ${this.trackId}`;
-
let points = [];
let track = [];
@@ -87,11 +86,11 @@ class MovescountMove extends MovescountBase {
if (trackResponse.status === 403) {
return [{error: 'Movescount user disabled viewing this activity'}];
}
+ let name = `Movescount move ${this.trackId}`;
const data = trackResponse.responseJSON;
if (!data) {
return [{name, error: 'UNSUPPORTED'}];
}
- let name = `Movescount move ${this.trackId}`;
const track = data.TrackPoints.map(trackPoint => ({
lat: trackPoint.Latitude,