From e1deec21bda1a5445143eb635f0181b6154bd279 Mon Sep 17 00:00:00 2001 From: SkateSpots Date: Sat, 26 Sep 2026 23:49:34 +0700 Subject: [PATCH] fix(map): hide the 'You are here' pin on desktop Location is a mobile-only affordance now (the desktop Near Me button was removed), so stop seeding the cached location on desktop and don't pass userLocation to the map on desktop. Result: no 'You are here' badge and no proximity sort on desktop; mobile is unchanged. Gate: 101 tests, 0 errors/warnings, boot smoke green. --- src/pages/MapPage.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/MapPage.tsx b/src/pages/MapPage.tsx index cb4a14e..930995f 100644 --- a/src/pages/MapPage.tsx +++ b/src/pages/MapPage.tsx @@ -12,6 +12,7 @@ import { filterByTrustLevel, type TrustFilterLevel } from '@/lib/trustFilter'; import { SortDropdown, type SortOption } from '@/components/SortDropdown'; import { calculateDistance } from '@/lib/sortOptions'; import { useZapTotals, zapTargetKey } from '@/hooks/useZapTotals'; +import { useIsMobile } from '@/hooks/useIsMobile'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Badge } from '@/components/ui/badge'; @@ -603,7 +604,11 @@ export default function MapPage() { const [sortBy, setSortBy] = useState('recent'); // Seed from the cached last-known location so the "you are here" badge and // proximity sorting are available instantly; a fresh fix updates it. + // Mobile-only: Near Me is a mobile affordance, so desktop shows no location + // pin (or proximity sort). + const isMobile = useIsMobile(); const [userLocation, setUserLocation] = useState<{lat: number; lon: number} | null>(() => { + if (!isMobile) return null; const cached = getLastLocation(); return cached ? { lat: cached.lat, lon: cached.lng } : null; }); @@ -1635,7 +1640,7 @@ export default function MapPage() { showCrews={showCrews} showBtcMap={showBtcMap} flyTo={flyTo} - userLocation={userLocation ? { lat: userLocation.lat, lng: userLocation.lon } : null} + userLocation={isMobile && userLocation ? { lat: userLocation.lat, lng: userLocation.lon } : null} /> {/* Loading indicator — a slim, honest top bar. The map stays