From c2b49d6e9cdf2f2ed3713abb77fee9ccf18d0c86 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:43:07 -0400 Subject: [PATCH] fix(actions/ui): Avoid setting ui_itineraryView on desktop --- lib/actions/ui.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/actions/ui.js b/lib/actions/ui.js index d6ac9743b..82bb689cb 100644 --- a/lib/actions/ui.js +++ b/lib/actions/ui.js @@ -368,15 +368,20 @@ export function handleBackButtonPress(e) { */ export function setItineraryView(value) { return function (dispatch, getState) { - const urlParams = coreUtils.query.getUrlParams() + if (coreUtils.ui.isMobile()) { + const urlParams = coreUtils.query.getUrlParams() - // If the itinerary value is changed, - // set the desired ui query param (even if LIST, so it replaces the current value) - // and store the current view as previousItineraryView. - if (value !== getItineraryView(urlParams)) { - urlParams.ui_itineraryView = value + // If the itinerary value is changed, + // set the desired ui query param (even if LIST, so it replaces the current value) + // and store the current view as previousItineraryView. + if (value !== getItineraryView(urlParams)) { + urlParams.ui_itineraryView = value - dispatch(setUrlSearch(urlParams)) + dispatch(setUrlSearch(urlParams)) + dispatch(settingItineraryView(value)) + } + } else { + // Don't set/use the ui_itineraryView in desktop mode. dispatch(settingItineraryView(value)) } }