moved logic
This commit is contained in:
parent
f378f690ab
commit
e370fc8072
1 changed files with 7 additions and 6 deletions
|
|
@ -13,12 +13,6 @@ import router from "@/router";
|
||||||
*/
|
*/
|
||||||
export async function getPageToRouteExistingOrderTo(toRoute = {}, existingHeritageOrder = false) {
|
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 the user is coming in via the Safelite.Com CTA
|
||||||
if (toRoute.query[queryStrings.START_TYPE] === 'fmg') {
|
if (toRoute.query[queryStrings.START_TYPE] === 'fmg') {
|
||||||
// If they have an existing order, return 'heritage' for the page name.
|
// 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.
|
// If this is not a direct link to a page using fmgPage, get the latest page.
|
||||||
const latestPageRoute = await getLatestPageForRedirection();
|
const latestPageRoute = await getLatestPageForRedirection();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue