parent
5080aa90d9
commit
96bc773797
1 changed files with 19 additions and 0 deletions
|
|
@ -14,11 +14,18 @@ import { runExperiments } from "@/router/methods/helpers/run-experiments";
|
|||
import { bailout } from "@/router/methods/error";
|
||||
import { checkPagePrerequisites } from "@/router/methods/page-prerequisites";
|
||||
import { checkLogParam } from "@/helpers/debug-log-helper";
|
||||
import { debugLog } from "@/helpers/debug-log-helper";
|
||||
|
||||
export async function beforeEach(to, from) {
|
||||
try {
|
||||
await analyticsMixin.methods.validateSession();
|
||||
|
||||
// prettier-ignore
|
||||
{
|
||||
debugLog(`--- before-each.js ${from?.name} start ---`);
|
||||
debugLog(" funnel cookie init: ", getFunnelCookie());
|
||||
}
|
||||
|
||||
if (getFunnelCookie()?.SuppressConceptFunnel) {
|
||||
// Redirect to heritage.
|
||||
return {
|
||||
|
|
@ -48,6 +55,12 @@ export async function beforeEach(to, from) {
|
|||
// Process funnel cookie.
|
||||
updateOrCreateFunnelCookie();
|
||||
|
||||
// prettier-ignore
|
||||
{
|
||||
debugLog(`--- before-each.js ${from?.name} start ---`);
|
||||
debugLog(" funnel cookie after: ", getFunnelCookie());
|
||||
}
|
||||
|
||||
// If sent from heritage, need to load session.
|
||||
const fromHeritageFlag = consumeQueryFromStash(queryStrings.FROM_HERITAGE);
|
||||
if (fromHeritageFlag) {
|
||||
|
|
@ -72,6 +85,12 @@ export async function beforeEach(to, from) {
|
|||
}
|
||||
|
||||
await runExperiments(to.name);
|
||||
|
||||
// prettier-ignore
|
||||
{
|
||||
debugLog("--- before-each.js end ---");
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
const errorPayload = {
|
||||
cause: "Uncaught exception in `beforeEach`.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue