From 0279267eedd85769ef65777612161961e45f05c8 Mon Sep 17 00:00:00 2001
From: Joni Laukka <joni.laukka.overflow@gmail.com>
Date: Tue, 11 Jun 2019 12:26:55 +0300
Subject: [PATCH] If tracking fails, the navigator will be disabled.

---
 src/components/UserMap.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/components/UserMap.js b/src/components/UserMap.js
index 1ec4c48..8438e3c 100644
--- a/src/components/UserMap.js
+++ b/src/components/UserMap.js
@@ -60,6 +60,10 @@ class UserMap extends Component {
         }
       }, (error) =>{
         console.log(error);
+        // disable tracking
+        if(this.watchPositionId != null){
+          navigator.geolocation.clearWatch(this.watchPositionId);
+        }
       }, options);
     }
   }
-- 
GitLab