diff --git a/langs/en.json b/langs/en.json index 4116b2af0..58634150d 100644 --- a/langs/en.json +++ b/langs/en.json @@ -193,6 +193,8 @@ "title": "Download", "uploadGpx": "Upload your track to OpenStreetMap" }, + "enableGeolocationForSafari": "Did you not get the popup to ask for geopermission?", + "enableGeolocationForSafariLink": "Learn how to enable the geolocation permission in settings", "error": "Something went wrong", "example": "Example", "examples": "Examples", @@ -249,7 +251,7 @@ "openTheMap": "Open the map", "openTheMapAtGeolocation": "Zoom to your location", "opening_hours": { - "closed_permanently": "Closed for an unkown duration", + "closed_permanently": "Closed for an unknown duration", "closed_until": "Closed until {date}", "error_loading": "Error: could not visualize these opening hours.", "loadingCountry": "Determining country…", diff --git a/src/Logic/State/GeoLocationState.ts b/src/Logic/State/GeoLocationState.ts index 7a1310db5..293edcda5 100644 --- a/src/Logic/State/GeoLocationState.ts +++ b/src/Logic/State/GeoLocationState.ts @@ -102,6 +102,10 @@ export class GeoLocationState { this.requestPermissionAsync() } + public static isSafari(): boolean{ + return navigator.permissions === undefined && navigator.geolocation !== undefined + } + /** * Requests the user to allow access to their position. * When granted, will be written to the 'geolocationState'. @@ -119,8 +123,12 @@ export class GeoLocationState { return } - if (navigator.permissions === undefined && navigator.geolocation !== undefined) { - // This is probably safari - we just start watching right away + if (GeoLocationState.isSafari()) { + // This is probably safari + // Safari does not support the 'permissions'-API for geolocation, + // so we just start watching right away + + this.permission.setData("requested") this.startWatching() return } diff --git a/src/UI/BigComponents/ThemeIntroPanel.svelte b/src/UI/BigComponents/ThemeIntroPanel.svelte index cdd5c9899..2a419b928 100644 --- a/src/UI/BigComponents/ThemeIntroPanel.svelte +++ b/src/UI/BigComponents/ThemeIntroPanel.svelte @@ -1,48 +1,51 @@