Merge branch 'CASH-313-button-triggers-chat' of https://github.com/Safelite/DigitalConsumer.FixMyGlass into CASH-313-button-triggers-chat
This commit is contained in:
commit
3794426207
2 changed files with 11 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ import { checkPagePrerequisites } from "@/router/methods/page-prerequisites";
|
|||
import { checkLogParam } from "@/helpers/debug-log-helper";
|
||||
import { debugLog } from "@/helpers/debug-log-helper";
|
||||
import { handleHeritageReturn } from "@/router/methods/helpers/handle-heritage-return";
|
||||
import { isVirtualRoute } from "@/router/methods/helpers/is-virtual-route";
|
||||
|
||||
export async function beforeEach(to, from) {
|
||||
try {
|
||||
|
|
@ -45,7 +46,9 @@ export async function beforeEach(to, from) {
|
|||
|
||||
// Block navigation if an order has been submitted.
|
||||
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
||||
if (to.name !== FUNNEL_START_PAGE.name && to.name !== routeData.CONFIRMATION.name) {
|
||||
const exceptionPages = [FUNNEL_START_PAGE.name, routeData.CONFIRMATION.name];
|
||||
|
||||
if (!exceptionPages.some((name) => to.name === name) && !isVirtualRoute(to.name)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
7
src/router/methods/helpers/is-virtual-route.js
Normal file
7
src/router/methods/helpers/is-virtual-route.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { routeData } from "@/router/constants/routes";
|
||||
|
||||
export function isVirtualRoute(routeName) {
|
||||
const matchedRoute = Object.values(routeData).find((route) => route.name === routeName);
|
||||
|
||||
return matchedRoute?.virtual ?? false;
|
||||
}
|
||||
Loading…
Reference in a new issue