prevent to open windo altert when geolocation not allow

This commit is contained in:
pramod mahajan 2025-08-02 19:04:14 +05:30
parent aece14d013
commit 99418e4870

View File

@ -1,4 +1,5 @@
import { useState, useEffect } from 'react';
import showToast from '../services/toastService';
export const usePositionTracker = () => {
const [coords, setCoords] = useState({ latitude: 0, longitude: 0 });
@ -9,7 +10,7 @@ export const usePositionTracker = () => {
setCoords(coords);
},
(error) => {
alert(error.message);
showToast("Please Allow Location","warn");
},
{ enableHighAccuracy: true, timeout: 20000, maximumAge: 1000 }
);