This commit is contained in:
FrankRua 2022-04-19 10:36:58 -04:00
parent e721d0deca
commit 2ab39d9ecf

View file

@ -55,6 +55,9 @@ export async function navigateToHeritageFunnel() {
);
}
/*
Logic for getting the last "valid" page a user visited.
*/
async function getLatestPageForRedirection() {
// If this is a non-CTA navigation, determine where to send the user based on page prerequisites.
// This also works if a user has a 'fmg' start_type query string but no current order.
@ -84,6 +87,10 @@ async function getLatestPageForRedirection() {
}
}
/*
Overrides functionality to go to the YMMS pages in certain cases.
If this is not one of the cases, it returns the default page value passed in.
*/
function overrideYmmsDirectionIfNeeded(toRoute, defaultPageValue) {
if (store.getters.payment.insuranceCoverage.isVerified) {
switch (toRoute.query[queryStrings.FMG_PAGE]) {
@ -103,6 +110,9 @@ function overrideYmmsDirectionIfNeeded(toRoute, defaultPageValue) {
}
}
/*
Determine if the page is a vin related page.
*/
function isVinRelatedPage(toRoute) {
return toRoute.query[queryStrings.FMG_PAGE] === fmgPageValues.VIN_LOOKUP ||
toRoute.query[queryStrings.FMG_PAGE] === fmgPageValues.LICENSE_PLATE_LOOKUP ||