diff --git a/src/constants/session-storage.js b/src/constants/session-storage.js index 577fa4c0f..589dd6b71 100644 --- a/src/constants/session-storage.js +++ b/src/constants/session-storage.js @@ -1,3 +1,3 @@ -export const sessionStorageKeyConstants = { - SUBMITTED_STATE: "submittedState" -} \ No newline at end of file +export const sessionStorageKeyConstants = { + SUBMITTED_STATE: "submittedState", +}; diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 73677726a..b29eae8c1 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -199,17 +199,25 @@ export default { } }, getSubmittedOrder() { - return JSON.parse(window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE))?.order; + return JSON.parse( + window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) + )?.order; }, hasSubmittedOrder() { - const submittedState = window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE); + const submittedState = window.sessionStorage.getItem( + sessionStorageKeyConstants.SUBMITTED_STATE + ); return submittedState !== null && submittedState.order !== null; }, getSubmittedApplicationUser() { - return JSON.parse(window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE))?.applicationUser; + return JSON.parse( + window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) + )?.applicationUser; }, hasSubmittedApplicationUser() { - const submittedState = window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE); + const submittedState = window.sessionStorage.getItem( + sessionStorageKeyConstants.SUBMITTED_STATE + ); return submittedState !== null && submittedState.applicationUser !== null; }, }, diff --git a/src/router/index.js b/src/router/index.js index 95aca54d8..5ec909f97 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -40,7 +40,6 @@ import { shouldStripPromoQueryString } from "@/helpers/promotions-helper"; import bailout from "@/layouts/bailout/bailout"; import { nextTick } from "vue"; import { getBoolFromString } from "@/helpers/boolean-helper"; -import { sessionStorageKeyConstants } from "../constants/session-storage"; const routes = [ { @@ -95,10 +94,15 @@ const routes = [ log(" --to.query.fmgPage ", to.query?.fmgPage); // Intercept all navigation if a submitted order exists in storage - if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) { + if ( + window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== + null + ) { if (to.query.fmgPage !== funnelStartPageName) { to.query.fmgPage = fmgPageValues.CONFIRMATION; - log(` --has ${sessionStorageKeyConstants.SUBMITTED_STATE} go to confirmation`); + log( + ` --has ${sessionStorageKeyConstants.SUBMITTED_STATE} go to confirmation` + ); } } // On entering the funnel "fresh", read cookie information, decide what to do next.