From 1729748690ae19733a7407b5a63ec3bfd073b925 Mon Sep 17 00:00:00 2001 From: Matt Caimi Date: Mon, 26 Jun 2023 13:35:23 -0400 Subject: [PATCH] CSR-1439 comments --- src/router/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 2663846ce..04d26c9d6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -161,9 +161,8 @@ const router = createRouter({ //---------------------------------------------------------- Router Functions ---------------------------------------------------------- router.beforeEach(async (to, from, next) => { - // Set the lastNavigationPage to the current page name for accurate tracking of page navigations. - // Since beforeEach() can be triggered before navigation resolution, to.name may sometimes be "root". - // In such cases, getPageName() from the analyticsMixin is used to accurately get the current page name. + // set lastNavigationPage here to capture state before API calls for analytics. + // use current page url query string name when to.name is "root" (due to unresolved navigation in beforeEach) router.lastNavigationPage = to.name == "root" ? analyticsMixin.methods.getPageName() : to.name; next();