Merge pull request #2232 from Safelite/feature/CASH-126

CASH-126
This commit is contained in:
CarlNation 2025-01-21 06:42:21 -05:00 committed by GitHub
commit f1d7b18ee9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

View file

@ -152,10 +152,10 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
&:first-child { &:first-child {
margin: 1rem .5rem 0 0; margin: 1rem 0.5rem 0 0;
} }
&:last-child { &:last-child {
margin: 1rem 0 0 .5rem; margin: 1rem 0 0 0.5rem;
} }
} }

View file

@ -82,6 +82,7 @@ const routes = [
const fromHeritage = getQuerystringParameter(queryStrings.FROM_HERITAGE) === "true"; const fromHeritage = getQuerystringParameter(queryStrings.FROM_HERITAGE) === "true";
const fromReturnUser = from?.name === fmgPageValues.RETURN_USER; const fromReturnUser = from?.name === fmgPageValues.RETURN_USER;
const toPaymentPage = to.query.fmgPage?.startsWith("payment");
// Intercept all navigation if a submitted order exists in storage // Intercept all navigation if a submitted order exists in storage
if (window.sessionStorage.getItem("submittedOrder") !== null) { if (window.sessionStorage.getItem("submittedOrder") !== null) {
@ -93,12 +94,14 @@ const routes = [
// On entering the funnel "fresh", read cookie information, decide what to do next. // On entering the funnel "fresh", read cookie information, decide what to do next.
else if (from.redirectedFrom === undefined || fromReturnUser) { else if (from.redirectedFrom === undefined || fromReturnUser) {
// if entering the funnel from non-funnel check and see if there is already a funnel cookie. // 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 // 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.
const funnelCookieLastTouched = getFunnelCookie()?.LastTouched; const funnelCookieLastTouched = getFunnelCookie()?.LastTouched;
if ( if (
to?.query?.fmgPage !== fmgPageValues.RETURN_USER && to?.query?.fmgPage !== fmgPageValues.RETURN_USER &&
!fromReturnUser && !fromReturnUser &&
!fromHeritage && !fromHeritage &&
!toPaymentPage &&
funnelCookieLastTouched !== null && funnelCookieLastTouched !== null &&
funnelCookieLastTouched !== undefined funnelCookieLastTouched !== undefined
) { ) {
@ -115,7 +118,7 @@ const routes = [
log(" --clear promise"); log(" --clear promise");
baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
if (!to.query.fmgPage?.startsWith("payment")) { if (!toPaymentPage) {
//payment pages used to return from safelitehop so exclude here //payment pages used to return from safelitehop so exclude here
// Remove the parameter after quote release // Remove the parameter after quote release