Merge pull request #3180 from Safelite/feature/CASH-2563

Feature/CASH 2563
This commit is contained in:
Chris 2026-05-15 10:49:43 -04:00 committed by GitHub
commit de38e3bf7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,15 +76,17 @@ export async function beforeEach(to, from) {
}
// Block navigation if an order has been submitted.
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
const exceptionPages = [
FUNNEL_START_PAGE.name,
routeData.CONFIRMATION.name,
routeData.BAILOUT_SUCCESS.name,
];
const submittedState = window.sessionStorage.getItem(
sessionStorageKeyConstants.SUBMITTED_STATE
);
if (submittedState !== null) {
const isBailout = getIsBailout(submittedState);
const exceptionPages = isBailout
? [FUNNEL_START_PAGE.name, routeData.BAILOUT_SUCCESS.name]
: [FUNNEL_START_PAGE.name, routeData.CONFIRMATION.name];
if (!exceptionPages.some((name) => to.name === name) && !isVirtualRoute(to.name)) {
if (to.name === routeData.BAILOUT.name) {
if (isBailout) {
router.push({
name: routeData.BAILOUT_SUCCESS.name,
});
@ -153,3 +155,8 @@ export async function beforeEach(to, from) {
return;
}
}
function getIsBailout(submittedState) {
const submittedStateObj = JSON.parse(submittedState);
return !!submittedStateObj?.applicationUser?.bailoutCode;
}