SSR-1260 Fix router params not working

This commit is contained in:
Josh Dassinger 2024-06-21 09:16:06 -05:00
parent b7094c0487
commit f2ab8fd299
2 changed files with 3 additions and 5 deletions

View file

@ -266,9 +266,7 @@ export default {
); );
}, },
shouldDisplayVehicleChangeAlert() { shouldDisplayVehicleChangeAlert() {
return this.$route.params[ return this.$router?.options?.history?.state[this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT] ?? false;
this.routerParams.DISPLAY_VEHICLE_CHANGE_ALERT
];
} }
}, },
methods: { 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) { 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) => { await saveSession({ shouldAwaitSaveSessionQueue: saveSessionSynchronous }).catch((error) => {
if (from.name === issPageValues.WELCOME_PAGE) { if (from.name === issPageValues.WELCOME_PAGE) {
store.setBailout(bailoutMessage.saveSessionError(error.data)); store.setBailout(bailoutMessage.saveSessionError(error.data));
@ -316,7 +316,7 @@ function navigate(
query: Object.assign(optionalQuery, { query: Object.assign(optionalQuery, {
issPage: matchingScenarioMap.destinationIssPageValue issPage: matchingScenarioMap.destinationIssPageValue
}), }),
params: optionalParams // TODO I don't think this actually works state: optionalParams
}); });
} else if (matchingScenarioMap.destinationUrl) { } else if (matchingScenarioMap.destinationUrl) {
navigateToUrl(matchingScenarioMap.destinationUrl, optionalQuery); navigateToUrl(matchingScenarioMap.destinationUrl, optionalQuery);