From 9107c05f89d57e29e2f0a36667cb689a9b560bc6 Mon Sep 17 00:00:00 2001 From: Houston Blyden Date: Thu, 20 May 2021 11:05:07 +0100 Subject: [PATCH] prevent removal of ticket search mode on clear (#56) --- 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: