diff --git a/frontend/src/components/blocks/Search/TopFiltersLayout.jsx b/frontend/src/components/blocks/Search/TopFiltersLayout.jsx index 9bf91a2..3d52ef3 100644 --- a/frontend/src/components/blocks/Search/TopFiltersLayout.jsx +++ b/frontend/src/components/blocks/Search/TopFiltersLayout.jsx @@ -78,6 +78,11 @@ const TopSideFacets = (props) => { '/en/collection-research/collection', ]; + const previousExhibitionPaths = [ + '/nl/zien-en-doen/geweest', + '/en/see-and-do/previous', + ]; + // Check if the current URL is one of the allowed paths and the specific query isn't present if ( allowedPaths.includes(location.pathname) && @@ -88,6 +93,14 @@ const TopSideFacets = (props) => { history.replace(newURL); // Update the URL + // Refresh the page to apply changes + window.location.reload(); + } else if( + previousExhibitionPaths.includes(location.pathname) && + !location.hash.includes('#query') + ){ + const newURL = `${location.pathname}${location.search}#query=%5B%7B"i"%3A"portal_type"%2C"o"%3A"paqo.selection.any"%2C"v"%3A%5B"exhibition"%5D%7D%5D&sort_on=eventTimeStart&sort_order=descending`; + history.replace(newURL); // Update the URL // Refresh the page to apply changes window.location.reload(); }