diff --git a/src/router/index.js b/src/router/index.js index ac1269eed..118e39cd1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -80,9 +80,9 @@ const routes = [ return; } - const fromHeritage = getQuerystringParameter(queryStrings.FROM_HERITAGE) === "true"; const fromReturnUser = from?.name === fmgPageValues.RETURN_USER; - const toPaymentPage = to.query.fmgPage?.startsWith("payment"); + const fromContentSite = getQuerystringParameter(queryStrings.START_TYPE) === "fmg"; + const toReturnUserPage = to.query?.fmgPage === fmgPageValues.RETURN_USER; // Intercept all navigation if a submitted order exists in storage if (window.sessionStorage.getItem("submittedOrder") !== null) { @@ -93,19 +93,15 @@ const routes = [ } // On entering the funnel "fresh", read cookie information, decide what to do next. else if (from.redirectedFrom === undefined || fromReturnUser) { - // if entering the funnel from non-funnel check and see if there is already a funnel cookie. - // if so, send them to return-user page. this is catching navigation from an external page. - // safeliteHop(payment) cancel or clicking back also trigger it so exclude payment. + // if entering the funnel from the content site, check and see if there is already a funnel cookie. + // if so, send them to return-user page. const funnelCookieLastTouched = getFunnelCookie()?.LastTouched; - if ( - to?.query?.fmgPage !== fmgPageValues.RETURN_USER && - !fromReturnUser && - !fromHeritage && - !toPaymentPage && + if (fromContentSite && funnelCookieLastTouched !== null && - funnelCookieLastTouched !== undefined + funnelCookieLastTouched !== undefined && + !toReturnUserPage ) { - log(" --navigate to return user"); + log(" --from content site navigate to return user"); router.push({ path: "/", query: { fmgPage: fmgPageValues.RETURN_USER }, @@ -118,7 +114,7 @@ const routes = [ log(" --clear promise"); baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); - if (!toPaymentPage) { + if (!to.query.fmgPage?.startsWith("payment")) { //payment pages used to return from safelitehop so exclude here // Remove the parameter after quote release