Browse code

GPX footer fix

louis.jonget authored on26/11/2022 09:18:50
Showing2 changed files
1 1
Binary files a/build/bike_companion.pbw and b/build/bike_companion.pbw differ
... ...
@@ -557,15 +557,18 @@ function init() {
557 557
   console.log("Custom web = " + ce + " (" + typeof ce + ")/ uploaded = " + cu + " (" + typeof cu + ")");
558 558
 
559 559
   if ((se && !su) || (ce && !cu)) {
560
+
561
+    var GPX = localStorage.getItem("GPX");
562
+    if (!GPX.substring(GPX.length - 6, 6) == "</gpx>") {
563
+      console.log("WARNING - NO GPX FOOTER : " + GPX.substring(GPX.length - 6, 6))
564
+      /*var footer = '</trkseg></trk></gpx>';
565
+      localStorage.setItem("GPX", GPX + footer);*/
566
+      GPXfooterBuilder();
567
+      console.log("GPX FOOTER is now : " + GPX.substring(GPX.length - 6, 6))
568
+    }
569
+
560 570
     if (se) {
561 571
       console.log("GPX upload needed to Strava")
562
-
563
-      var GPX = localStorage.getItem("GPX");
564
-      if (!GPX.substring(GPX.length - 6, 6) == "</gpx>") {
565
-        var footer = '</trkseg></trk></gpx>';
566
-        localStorage.setItem("GPX", GPX + footer);
567
-        GPXfooterBuilder();
568
-      }
569 572
       SendToStrava();
570 573
     }
571 574