From 69d7169b987da33609a84a81f28ba5a95caed841 Mon Sep 17 00:00:00 2001 From: Mohd Kaif Ansari <155880242+techykaif@users.noreply.github.com> Date: Sat, 22 Aug 2026 00:09:19 +0530 Subject: [PATCH] fix(map): remove stale place ids from shared urls --- src/components/map/places-map.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/map/places-map.tsx b/src/components/map/places-map.tsx index f337cfa..a4b3b55 100644 --- a/src/components/map/places-map.tsx +++ b/src/components/map/places-map.tsx @@ -61,7 +61,8 @@ export function PlacesMap({ places }: PlacesMapProps) { const [debouncedQuery, setDebouncedQuery] = React.useState(""); const [focusId, setFocusId] = React.useState(() => { if (typeof window === "undefined") return null; - return parseMapState(window.location.search).placeId ?? null; + const id = parseMapState(window.location.search).placeId ?? null; + return id && places.some((place) => place.id === id) ? id : null; }); // A viewport in the URL restores that exact center/zoom on load instead of // fitting all places; it is then kept in sync as the user pans (see #118).