fix: Set osm_type/osm_id from wikidata response for wiki summaries

When clicking basemap labels, reverse geocode is now skipped to avoid
entity corruption. The wikidata effect needs to set osm_type/osm_id
from the osm_relation_id in the response to trigger Effect 3 which
fetches the wiki summary from /api/place/R/{id}.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-05-02 05:04:34 +00:00
commit cd080b42f3

View file

@ -408,6 +408,16 @@ export function PlaceCard({ place, variant = "preview", expanded = true, onToggl
osm_relation_id: data.osm_relation_id,
extratags: { ...(prev && prev !== "loading" ? prev.extratags : {}), ...data.extratags },
}))
// Set osm_type/osm_id from osm_relation_id to trigger Effect 3 (wiki summary fetch)
if (data?.osm_relation_id) {
const current = useStore.getState().selectedPlace
if (current && current.lat === placeLat && current.lon === placeLon) {
useStore.getState().setSelectedPlace({
...current,
raw: { ...current.raw, osm_type: 'R', osm_id: data.osm_relation_id }
})
}
}
if (data?.boundary) {
const current = useStore.getState().selectedPlace
if (current && current.lat === placeLat && current.lon === placeLon) {