CSR-1816 | SaveSessionPromise invalidation fix

Separate out the saveSessionPromise reset from other  "fresh" funnel entry logic
This commit is contained in:
Scott Kiener 2023-11-21 10:27:16 -05:00
parent 637919abd2
commit 76905cb3f1

View file

@ -61,30 +61,29 @@ const routes = [
to.query.fmgPage = "confirmation"; to.query.fmgPage = "confirmation";
} }
} }
// On entering the funnel "fresh", read cookie information, decide what to do next. payment pages used to return from safelitehop so exclude here // On entering the funnel "fresh", read cookie information, decide what to do next.
else if ( else if (from.redirectedFrom === undefined) {
from.redirectedFrom === undefined &&
!to.query.fmgPage !== "payment" &&
!to.query.fmgPage !== "payment-pia-return"
) {
// clear the saveSessionPromise - if it exists in the vuex store but a new instance was created // clear the saveSessionPromise - if it exists in the vuex store but a new instance was created
// the saveSessionPromise will no longer point to a valid promise // the saveSessionPromise will no longer point to a valid promise
baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
// Remove the parameter after quote release if (!to.query.fmgPage.startsWith("payment")) {
const loadSessionResponse = await loadSessionIfPresent( //payment pages used to return from safelitehop so exclude here
to.query.isInsurance != null // Remove the parameter after quote release
? to.query.isInsurance == "true" const loadSessionResponse = await loadSessionIfPresent(
? true to.query.isInsurance != null
: false ? to.query.isInsurance == "true"
: null, ? true
to.query.fmgPage : false
); : null,
to.query.fmgPage
);
const pageToRedirectTo = await getPageToRouteExistingOrderTo(to); const pageToRedirectTo = await getPageToRouteExistingOrderTo(to);
// Assign our fmgPage so it will load normally like the other pages. // Assign our fmgPage so it will load normally like the other pages.
to.query.fmgPage = pageToRedirectTo; to.query.fmgPage = pageToRedirectTo;
}
} }
await runExperiments(to.query.fmgPage); await runExperiments(to.query.fmgPage);