Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly save sessionId when starting over #1225

Merged
merged 4 commits into from
Jun 5, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/reducers/create-otp-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ export function getInitialState(userDefinedConfig) {
...(transitModeSettings || [])
]

const sessionId = new URLSearchParams(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use new URLSearchParams(getUrlParams()) from core-utils.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch thanks!

document.location.hash.split('#/')?.[1]
).get('sessionId')

return {
activeSearchId: 0,
config,
Expand All @@ -164,7 +168,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: {
Expand Down
Loading