From 4c5d24a0a7dacc393c0a4328c99b5e5e08058b0b Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 26 Feb 2024 14:12:30 +0100 Subject: [PATCH] Fix: also show location info on shake if GPS is disabled --- src/UI/BigComponents/MapCenterDetails.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/UI/BigComponents/MapCenterDetails.svelte b/src/UI/BigComponents/MapCenterDetails.svelte index bdbdd67cb..05a1096c5 100644 --- a/src/UI/BigComponents/MapCenterDetails.svelte +++ b/src/UI/BigComponents/MapCenterDetails.svelte @@ -23,7 +23,7 @@ bearing: number }> = map.location.mapD( ({ lon, lat }) => { - const current = currentLocation.data + const current = currentLocation?.data if (!current) { return undefined } @@ -41,6 +41,9 @@ let compass = Orientation.singleton.alpha let relativeBearing: Store<{ distance: string; bearing: Translation }> = compass.mapD( (compass) => { + if(!distanceToCurrentLocation.data){ + return undefined + } const bearing: Translation = relativeDir[ GeoOperations.bearingToHumanRelative(distanceToCurrentLocation.data.bearing - compass)