mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
keep cancelled outline and search asks free during the Nominatim probe
Recheck the caller's signal right after the capability probe on every path, so an ask cleared while the probe is pending starts no outline or last-resort search request, whether the probe says configured, unknown or not configured.
This commit is contained in:
1 parent
f32ab5446b
commit
3824b4ebfc
4 files changed
+69
-7
No files matched your search
@@ -80,11 +80,12 @@ export function createDefaultPlaceSearch({
|
||||
createGoogleGeocoder({
|
||||
async request(query, { bias, signal }) {
|
||||
// The app's own route says up front when Nominatim is off.
|
||||
if (
|
||||
nominatimConfigured &&
|
||||
(await nominatimConfigured()) === false
|
||||
)
|
||||
return null;
|
||||
const capability = nominatimConfigured
|
||||
? await nominatimConfigured()
|
||||
: null;
|
||||
// A search cancelled during the probe starts no request.
|
||||
signal?.throwIfAborted();
|
||||
if (capability === false) return null;
|
||||
const params = new URLSearchParams({ q: query });
|
||||
if (bias) params.set('bounds', bias);
|
||||
return fetchImpl(
|
||||
|
||||
Reference in new issue
Block a user