From f2ab8fd2997d64ee75ffb57da1c894c382a4c401 Mon Sep 17 00:00:00 2001 From: Josh Dassinger Date: Fri, 21 Jun 2024 09:16:06 -0500 Subject: [PATCH] SSR-1260 Fix router params not working --- src/layouts/vehicle-damage/vehicle-damage.vue | 4 +--- src/router/index.js | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 7e37cb1a..89b42094 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -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: { diff --git a/src/router/index.js b/src/router/index.js index b51c31c2..388a978c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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);