mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 22:54:42 +02:00
fix: duplicate stop when GPS denied and selecting origin via search
Bug: clicking Get Directions with GPS denied would add the destination to stops AND set pendingDestination. Then when user selected an origin via search, selectResult would add the origin AND re-add the pending destination, resulting in 3 stops (A=dest, B=origin, C=dest again). Fix: in startDirections GPS-denied path, only set pendingDestination without adding to stops. The SearchBar selectResult handler already adds both origin and pending destination when pending exists.
This commit is contained in:
parent
721bc2c9f5
commit
9db8cec0f6
1 changed files with 1 additions and 3 deletions
|
|
@ -85,9 +85,7 @@ export const useStore = create((set, get) => ({
|
||||||
addStop({ lat: place.lat, lon: place.lon, name: place.name, source: place.source, matchCode: place.matchCode })
|
addStop({ lat: place.lat, lon: place.lon, name: place.name, source: place.source, matchCode: place.matchCode })
|
||||||
set({ selectedPlace: null })
|
set({ selectedPlace: null })
|
||||||
} else {
|
} else {
|
||||||
// GPS denied, no stops: add destination, show empty origin slot
|
// GPS denied, no stops: set pendingDestination only; origin-picker will add both
|
||||||
clearStops()
|
|
||||||
addStop({ lat: place.lat, lon: place.lon, name: place.name, source: place.source, matchCode: place.matchCode })
|
|
||||||
set({ pendingDestination: place, selectedPlace: null })
|
set({ pendingDestination: place, selectedPlace: null })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue