From 3f908bcfdc4b6d48ac191034d2dc12cd7e74be00 Mon Sep 17 00:00:00 2001 From: houbly Date: Tue, 18 May 2021 16:53:58 +0100 Subject: [PATCH] prevent removal of ticket search mode on clear --- src/globalState/AutoCompleteContext.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/globalState/AutoCompleteContext.js b/src/globalState/AutoCompleteContext.js index c4923f8..744fd1c 100644 --- a/src/globalState/AutoCompleteContext.js +++ b/src/globalState/AutoCompleteContext.js @@ -124,12 +124,13 @@ export const AutoCompleteProvider = (props) => { // Used to reset everything case 'RESET_SELECTED_SERVICES': getAllSearchParams().forEach((param) => { - delSearchParam(param.name); + if (param.name !== 'ticketSearch') { + delSearchParam(param.name); + } }); return { + ...initialState, mapRef: state.mapRef, - queries: initialState.queries, - selectedStations: initialState.selectedStations, }; // Default should return intial state if error default: