From ba6027dda367e0e13ff26fa409df2cbc81cc0b61 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 12 Aug 2024 10:04:28 +0200 Subject: [PATCH] Improve geolocation message --- src/Logic/State/GeoLocationState.ts | 7 ++++--- src/UI/BigComponents/GeolocationControl.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Logic/State/GeoLocationState.ts b/src/Logic/State/GeoLocationState.ts index 3e26374fc9..a17da91e35 100644 --- a/src/Logic/State/GeoLocationState.ts +++ b/src/Logic/State/GeoLocationState.ts @@ -105,6 +105,9 @@ export class GeoLocationState { this.gpsStateExplanation = this.gpsAvailable.map(available => { + if (this.currentGPSLocation.data !== undefined) { + return Translations.t.general.labels.jumpToLocation + } if (!available) { return Translations.t.general.labels.locationNotAvailable } @@ -123,9 +126,7 @@ export class GeoLocationState { return Translations.t.general.visualFeedback.islocked } - if (this.currentGPSLocation.data !== undefined) { - return Translations.t.general.labels.jumpToLocation - } + return Translations.t.general.waitingForLocation }, [this.allowMoving, this.permission, this.currentGPSLocation]) diff --git a/src/UI/BigComponents/GeolocationControl.ts b/src/UI/BigComponents/GeolocationControl.ts index febe212bfd..2052a759df 100644 --- a/src/UI/BigComponents/GeolocationControl.ts +++ b/src/UI/BigComponents/GeolocationControl.ts @@ -81,13 +81,13 @@ export class GeolocationControlState { return } - // A location _is_ known! Let's move to this location const currentLocation = geolocationState.currentGPSLocation.data if (currentLocation === undefined) { // No location is known yet, not much we can do lastClick.setData(new Date()) return } + // A location _is_ known! Let's move to this location const inBounds = state.bounds.data.contains([ currentLocation.longitude, currentLocation.latitude,