From b952fef1950b3f05895a723293d0c1700e7106d1 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Wed, 15 Dec 2021 21:06:40 +0000 Subject: [PATCH] Don't include the accuracy parameter in location events if accuracy could not be determined. (#7375) * Don't include accuracy on geouri if not defined * Use !== undefined * Add a ) --- src/components/views/location/LocationPicker.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/views/location/LocationPicker.tsx b/src/components/views/location/LocationPicker.tsx index b5ed928dd35..f3f4d649860 100644 --- a/src/components/views/location/LocationPicker.tsx +++ b/src/components/views/location/LocationPicker.tsx @@ -188,9 +188,10 @@ class LocationPicker extends React.Component { private getGeoUri = (position) => { return (`geo:${ position.coords.latitude },` + position.coords.longitude + - ( position.coords.altitude != null ? + ( position.coords.altitude !== undefined ? `,${ position.coords.altitude }` : '' ) + - `;u=${ position.coords.accuracy }`); + ( position.coords.accuracy !== undefined ? + `;u=${ position.coords.accuracy }` : '' )); }; private onOk = () => {