Merge pull request #764 from Safelite/defect/digital/SSR-1260

SSR-1260 Fix router params not working
This commit is contained in:
Josh Dassinger 2024-06-21 10:25:25 -05:00 committed by GitHub
commit 1f476e4000
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View file

@ -266,9 +266,7 @@ export default {
);
},
shouldDisplayVehicleChangeAlert() {
return this.$route.params[
this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT
];
return this.$router?.options?.history?.state[this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT] ?? false;
}
},
methods: {

View file

@ -171,7 +171,7 @@ router.afterEach(async (to, from) => {
}
if (to.query.issPage !== issPageValues.TPA_CONFIRMATION && to.query.issPage !== issPageValues.ORDER_CONFIRMATION) {
const saveSessionSynchronous = !!from.params[routerParams.SAVE_SESSION_SYNCHRONOUS];
const saveSessionSynchronous = !!router.options.history.state[routerParams.SAVE_SESSION_SYNCHRONOUS];
await saveSession({ shouldAwaitSaveSessionQueue: saveSessionSynchronous }).catch((error) => {
if (from.name === issPageValues.WELCOME_PAGE) {
store.setBailout(bailoutMessage.saveSessionError(error.data));
@ -316,7 +316,7 @@ function navigate(
query: Object.assign(optionalQuery, {
issPage: matchingScenarioMap.destinationIssPageValue
}),
params: optionalParams // TODO I don't think this actually works
state: optionalParams
});
} else if (matchingScenarioMap.destinationUrl) {
navigateToUrl(matchingScenarioMap.destinationUrl, optionalQuery);