@digitransit-component/digitransit-component-autosuggest 8.0.9 → 9.0.0

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/lib/index.js CHANGED
@@ -5626,7 +5626,7 @@ function getSearchResults(targets, sources, transportMode, searchContext, filter
5626
5626
  searchComponents.push(getGeocodingResults(input, searchParams, language, focusPoint, geocodingSources.join(','), URL_PELIAS, minimalRegexp, geocodingLayers));
5627
5627
  }
5628
5628
  if (allSources || sources.includes('History')) {
5629
- const locationHistory = getOldSearches(context, 'endpoint');
5629
+ const locationHistory = getOldSearches('endpoint');
5630
5630
  const dropLayers = ['bikestation'];
5631
5631
  dropLayers.push(...stopLayers);
5632
5632
  dropLayers.push(...routeLayers);
@@ -5650,7 +5650,7 @@ function getSearchResults(targets, sources, transportMode, searchContext, filter
5650
5650
  }));
5651
5651
  }
5652
5652
  if (allSources || sources.includes('History')) {
5653
- const history = getOldSearches(context);
5653
+ const history = getOldSearches();
5654
5654
  const dropLayers = ['bikestation'];
5655
5655
  dropLayers.push(...stopLayers);
5656
5656
  dropLayers.push(...routeLayers);
@@ -5709,7 +5709,7 @@ function getSearchResults(targets, sources, transportMode, searchContext, filter
5709
5709
  }));
5710
5710
  }
5711
5711
  if (allSources || sources.includes('History')) {
5712
- const stopHistory = getOldSearches(context).filter(item => {
5712
+ const stopHistory = getOldSearches().filter(item => {
5713
5713
  if (item.properties.gid) {
5714
5714
  return item.properties.gid.includes('GTFS:');
5715
5715
  }
@@ -5739,7 +5739,7 @@ function getSearchResults(targets, sources, transportMode, searchContext, filter
5739
5739
  }
5740
5740
  searchComponents.push(getRoutesQuery(input, feedIDs, transportMode, pathOpts).then(result => filterResults ? filterResults(result, mode, 'Routes') : result));
5741
5741
  if (allSources || sources.includes('History')) {
5742
- const routeHistory = getOldSearches(context);
5742
+ const routeHistory = getOldSearches();
5743
5743
  const dropLayers = ['bikestation'];
5744
5744
  if (transportMode) {
5745
5745
  dropLayers.push(...routeLayers.filter(i => !(i === transportMode)));
@@ -5768,7 +5768,7 @@ function getSearchResults(targets, sources, transportMode, searchContext, filter
5768
5768
  }));
5769
5769
  }
5770
5770
  if (allSources || sources.includes('History')) {
5771
- const history = getOldSearches(context);
5771
+ const history = getOldSearches();
5772
5772
  const dropLayers = [...stopLayers];
5773
5773
  dropLayers.push(...routeLayers);
5774
5774
  dropLayers.push(...locationLayers);
@@ -7723,14 +7723,13 @@ function DTAutosuggest({
7723
7723
  });
7724
7724
  const mobileClearOldSearches = () => {
7725
7725
  const {
7726
- context,
7727
7726
  clearOldSearches,
7728
7727
  clearFutureRoutes
7729
7728
  } = searchContext;
7730
- if (context && clearOldSearches) {
7731
- clearOldSearches(context);
7729
+ if (clearOldSearches) {
7730
+ clearOldSearches();
7732
7731
  if (clearFutureRoutes) {
7733
- clearFutureRoutes(context);
7732
+ clearFutureRoutes();
7734
7733
  }
7735
7734
  fetchSuggestions(state.value);
7736
7735
  }