From 36ab8e04ebf879d05455e675b6f7cdfca566936a Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 1 Nov 2023 15:32:00 -0400 Subject: [PATCH] Redirect to confirmation if submitted order is present --- src/router/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index 0a1bef3a3..cec3ff193 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -55,8 +55,17 @@ const routes = [ await GoToFunnelStartOn404(next); } + // Intercept all navigation if a submitted order exists in storage + if (store.getters.hasSubmittedOrder) { + if (to.query.fmgPage !== "vehicle") { + 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 - if (from.redirectedFrom === undefined && !to.query.fmgPage.startsWith("payment")) { + else if ( + from.redirectedFrom === undefined && + !to.query.fmgPage.startsWith("payment") + ) { // 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 baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);