From 6d0dd974332fc3fc0292b9ecdffc835cbc3b0896 Mon Sep 17 00:00:00 2001 From: Tasso Date: Tue, 31 Dec 2024 16:45:49 -0300 Subject: [PATCH] Fix `ShareLocationModal` --- .../views/room/ShareLocation/ShareLocationModal.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/meteor/client/views/room/ShareLocation/ShareLocationModal.tsx b/apps/meteor/client/views/room/ShareLocation/ShareLocationModal.tsx index f9e0272d33e9..90b0ee999426 100644 --- a/apps/meteor/client/views/room/ShareLocation/ShareLocationModal.tsx +++ b/apps/meteor/client/views/room/ShareLocation/ShareLocationModal.tsx @@ -17,15 +17,15 @@ type ShareLocationModalProps = { const ShareLocationModal = ({ rid, tmid, onClose }: ShareLocationModalProps): ReactElement => { const t = useTranslation(); const dispatchToast = useToastMessageDispatch(); - const { data: permissionData, isLoading: permissionLoading } = useQuery({ + const { data: permissionState, isLoading: permissionLoading } = useQuery({ queryKey: ['geolocationPermission'], - ...getGeolocationPermission, + queryFn: getGeolocationPermission, }); const { data: positionData } = useQuery({ - queryKey: ['geolocationPosition', permissionData], + queryKey: ['geolocationPosition', permissionState], queryFn: async () => { - if (permissionLoading || permissionData === 'prompt' || permissionData === 'denied') { + if (permissionLoading || permissionState === 'prompt' || permissionState === 'denied') { return; } return getGeolocationPosition(); @@ -68,7 +68,7 @@ const ShareLocationModal = ({ rid, tmid, onClose }: ShareLocationModalProps): Re } }; - if (permissionLoading || permissionData === 'prompt') { + if (permissionLoading || permissionState === 'prompt') { return ( {t('The_necessary_browser_permissions_for_location_sharing_are_not_granted')}