Skip to content

Commit

Permalink
Keep full page map location filter for pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
nmanu1 committed Apr 11, 2024
1 parent 6386faf commit 630393f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions static/js/theme-map/VerticalFullPageMapOrchestrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ZoomTriggers from './Maps/ZoomTriggers.js';
import PanTriggers from './Maps/PanTriggers.js';
import MobileStates from './MobileStates';

import QueryTriggers from '../constants/query-triggers.js';
import StorageKeys from '../constants/storage-keys.js';

/**
Expand Down Expand Up @@ -184,7 +185,13 @@ class VerticalFullPageMapOrchestrator extends ANSWERS.Component {
this.core.storage.registerListener({
eventType: 'update',
storageKey: StorageKeys.QUERY,
callback: () => this.updateMostRecentSearchState()
callback: () => {
const queryTrigger = this.core.storage.get(StorageKeys.QUERY_TRIGGER);
if (queryTrigger !== QueryTriggers.PAGINATION) {
this.core.clearStaticFilterNode('SearchThisArea');
}
this.updateMostRecentSearchState();
}
});

const searchThisAreaToggleEls = this._container.querySelectorAll('.js-searchThisAreaToggle');
Expand Down Expand Up @@ -680,7 +687,6 @@ class VerticalFullPageMapOrchestrator extends ANSWERS.Component {
useFacets: true
});
this.updateMostRecentSearchState();
this.core.clearStaticFilterNode('SearchThisArea');
}

/**
Expand Down

0 comments on commit 630393f

Please sign in to comment.