From a2bb7b93ccaef675cd1dceb5ed68687d75ff3ef2 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 6 Feb 2024 22:38:47 +0100 Subject: [PATCH] Use privateLat and privateLong to initialize location picker if present (#1111) --- .../LocationPicker/LocationPickerContainer.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/LocationPicker/LocationPickerContainer.js b/src/components/LocationPicker/LocationPickerContainer.js index a2ab6d4d8..42937c2af 100644 --- a/src/components/LocationPicker/LocationPickerContainer.js +++ b/src/components/LocationPicker/LocationPickerContainer.js @@ -55,8 +55,14 @@ const reducer = ( state, action ) => { ...state.region, // This was causing a crash when getting to the location picker before // current location was fetched in the observation viewer - latitude: action.currentObservation?.latitude || 0.0, - longitude: action.currentObservation?.longitude || 0.0, + latitude: + action.currentObservation?.privateLatitude + || action.currentObservation?.latitude + || 0.0, + longitude: + action.currentObservation?.privateLongitude + || action.currentObservation?.longitude + || 0.0, latitudeDelta: DELTA, longitudeDelta: DELTA }