mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 14:44:51 +02:00
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:
parent
3158537488
commit
cd080b42f3
1 changed files with 10 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue