From 480ef96a9bb7b3050f4d95836174ab3f43b82a4b Mon Sep 17 00:00:00 2001 From: Thalyta Fabrine Date: Wed, 27 Jan 2021 14:55:13 -0300 Subject: [PATCH] Use searchState of the sessionStorage --- CHANGELOG.md | 3 +++ react/SearchContext.jsx | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 998af2ad4..0ee80a146 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed +- Use `searchState` of the `sessionStorage` when it exists. + ## [2.110.0] - 2020-12-11 ### Added - PDP critical CSS settings on schema. diff --git a/react/SearchContext.jsx b/react/SearchContext.jsx index b4ed7e4fa..ce4bbfd72 100644 --- a/react/SearchContext.jsx +++ b/react/SearchContext.jsx @@ -85,6 +85,10 @@ const SearchContext = ({ const queryValue = getCorrectQueryValue().replace(/\$2F/gi, '%2F') const mapValue = queryField ? mapField : map + const state = + (typeof sessionStorage !== 'undefined' && + sessionStorage.getItem('searchState')) || + searchState return ( {(searchQuery, extraParams) => {