@maptiler/geocoding-control 0.0.57 → 0.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/geocoding-control",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Martin Ždila",
@@ -318,7 +318,7 @@
318
318
 
319
319
  const sp = new URLSearchParams();
320
320
 
321
- if (language) {
321
+ if (language != undefined) {
322
322
  sp.set(
323
323
  "language",
324
324
  Array.isArray(language) ? language.join(",") : language
@@ -380,13 +380,19 @@
380
380
 
381
381
  abortController?.abort();
382
382
 
383
- abortController = new AbortController();
383
+ const ac = new AbortController();
384
+
385
+ abortController = ac;
384
386
 
385
387
  let res: Response;
386
388
 
387
389
  try {
388
- res = await fetch(url, { signal: abortController.signal }).finally(() => {
389
- abortController = undefined;
390
+ console.log("fetch");
391
+
392
+ res = await fetch(url, { signal: ac.signal }).finally(() => {
393
+ if (ac === abortController) {
394
+ abortController = undefined;
395
+ }
390
396
  });
391
397
  } catch (e) {
392
398
  if (e && typeof e === "object" && (e as any).name === "AbortError") {