From a3dad2cbec13cb06f97488795194dfb50ea7128d Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Sat, 25 Jul 2026 00:32:03 +0700 Subject: [PATCH] Geolocation: handle 'no provider' case (GrapheneOS / no Play Services) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause of the persistent Near Me failure: the test device runs GrapheneOS with no Google Play Services, so there's no network/fused location provider — only raw GPS, which can't fix indoors. This was never a code bug. - Add 'no_provider' GeoErrorKind; detect it from native error text (disabled / provider / settings / unavailable). - Show accurate, actionable messaging: tell the user to enable Network Location (Settings → Location) — the GrapheneOS-friendly fix — or use GPS outdoors, instead of a vague timeout. - Refine the timeout copy along the same lines. Co-authored-by: shakespeare.diy --- src/lib/geolocation.ts | 22 ++++++++++++++++++---- src/pages/MapPage.tsx | 14 +++++++++++++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/lib/geolocation.ts b/src/lib/geolocation.ts index f952909..2dd65e4 100644 --- a/src/lib/geolocation.ts +++ b/src/lib/geolocation.ts @@ -46,7 +46,7 @@ export interface GeoCoords { lng: number; } -export type GeoErrorKind = 'denied' | 'unavailable' | 'timeout'; +export type GeoErrorKind = 'denied' | 'unavailable' | 'timeout' | 'no_provider'; export class GeolocationError extends Error { kind: GeoErrorKind; @@ -319,12 +319,26 @@ async function getNativePosition(native: CapGeolocationPlugin): Promise