diff --git a/lib/reducers/create-otp-reducer.js b/lib/reducers/create-otp-reducer.js index a2c39ddc2..69b33584d 100644 --- a/lib/reducers/create-otp-reducer.js +++ b/lib/reducers/create-otp-reducer.js @@ -16,7 +16,7 @@ import { getISOLikeTimestamp } from '../util/state' import { MainPanelContent, MobileScreens } from '../actions/ui-constants' const { filterProfileOptions } = coreUtils.profile -const { getDefaultQuery } = coreUtils.query +const { getDefaultQuery, getUrlParams } = coreUtils.query const { getItem } = coreUtils.storage const { getUserTimezone } = coreUtils.time @@ -153,6 +153,8 @@ export function getInitialState(userDefinedConfig) { ...(transitModeSettings || []) ] + const sessionId = new URLSearchParams(getUrlParams()).get('sessionId') + return { activeSearchId: 0, config, @@ -164,7 +166,9 @@ export function getInitialState(userDefinedConfig) { type: config.itinerary?.defaultSort || 'BEST' } }, - initialUrl: window.location.pathname, + initialUrl: `${window.location.pathname}${ + sessionId ? `?sessionId=${sessionId}` : '' + }`, lastActionMillis: 0, location: { currentPosition: {