MCPcopy Create free account
hub / github.com/ImGoodBai/MapGoGoGo / checkLocationPermission

Function checkLocationPermission

frontend/src/App.tsx:790–805  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

788 }
789
790 async function checkLocationPermission() {
791 const permissionsApi = (navigator as any).permissions;
792 if (!permissionsApi?.query) return "";
793 try {
794 const result = await permissionsApi.query({ name: "geolocation" as PermissionName });
795 if (result.state === "denied") {
796 return "浏览器显示本站定位权限已被拒绝,请先在 Safari 网站设置或 iPhone 定位服务里改为允许。";
797 }
798 if (result.state === "prompt") {
799 return "浏览器应该会弹出定位授权,请选择允许。";
800 }
801 return "";
802 } catch {
803 return "";
804 }
805 }
806
807 async function startTracking() {
808 if (!navigator.geolocation) {

Callers 1

startTrackingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected