moved logic

This commit is contained in:
FrankRua 2022-04-18 17:19:31 -04:00
parent f378f690ab
commit e370fc8072

View file

@ -13,12 +13,6 @@ import router from "@/router";
*/
export async function getPageToRouteExistingOrderTo(toRoute = {}, existingHeritageOrder = false) {
// If navigating to a specific page, and that page is not part of the vin pages.
// Return that page, so that it can navigate like normal.
if (toRoute.query[queryStrings.FMG_PAGE] !== undefined && !isVinRelatedPage(toRoute)) {
return overrideYmmsDirectionIfNeeded(toRoute, toRoute.query[queryStrings.FMG_PAGE]);
}
// If the user is coming in via the Safelite.Com CTA
if (toRoute.query[queryStrings.START_TYPE] === 'fmg') {
// If they have an existing order, return 'heritage' for the page name.
@ -27,6 +21,13 @@ export async function getPageToRouteExistingOrderTo(toRoute = {}, existingHerita
}
}
// If navigating to a specific page, and that page is not part of the vin pages.
// Return that page, so that it can navigate like normal.
if (toRoute.query[queryStrings.FMG_PAGE] !== undefined && !isVinRelatedPage(toRoute)) {
return overrideYmmsDirectionIfNeeded(toRoute, toRoute.query[queryStrings.FMG_PAGE]);
}
// If this is not a direct link to a page using fmgPage, get the latest page.
const latestPageRoute = await getLatestPageForRedirection();