From 2913c282717795be0c76678f8e45b5a0af3c0adb Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 29 Jul 2020 20:55:25 +0200 Subject: [PATCH] Fix geolocalisation bugs on webkit --- Logic/GeoLocationHandler.ts | 4 ++-- Logic/OsmConnection.ts | 1 + index.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Logic/GeoLocationHandler.ts b/Logic/GeoLocationHandler.ts index 29ae5c5..930e0ad 100644 --- a/Logic/GeoLocationHandler.ts +++ b/Logic/GeoLocationHandler.ts @@ -65,8 +65,8 @@ export class GeoLocationHandler extends UIElement { self._marker = newMarker; }); - navigator.permissions.query({name: 'geolocation'}) - .then(function (status) { + navigator?.permissions?.query({name: 'geolocation'}) + ?.then(function (status) { console.log("Geolocation is already", status) if (status.state === "granted") { self.StartGeolocating(); diff --git a/Logic/OsmConnection.ts b/Logic/OsmConnection.ts index e07751d..a0e2b8d 100644 --- a/Logic/OsmConnection.ts +++ b/Logic/OsmConnection.ts @@ -31,6 +31,7 @@ export class OsmConnection { this.userDetails.data.osmConnection = this; this.userDetails.data.dryRun = dryRun; this._dryRun = dryRun; + if (this.auth.authenticated()) { this.AttemptLogin(); // Also updates the user badge diff --git a/index.html b/index.html index 6ef7683..bc19887 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@
- +