From cbfd6e49d23136001025547e16c00917c75f9936 Mon Sep 17 00:00:00 2001 From: Matt Caimi Date: Mon, 26 Jun 2023 12:25:22 -0400 Subject: [PATCH] CSR-1439 handle browser navigation --- 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 231db1e3c..d82c13ac9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -159,8 +159,9 @@ const router = createRouter({ }); //---------------------------------------------------------- Router Functions ---------------------------------------------------------- + router.beforeEach(async (to, from, next) => { - router.lastNavigationPage = to.name; + router.lastNavigationPage = to.name == "root" ? analyticsMixin.methods.getPageName() : to.name; next(); }); @@ -168,8 +169,6 @@ router.afterEach(async (to, from) => { // Update lastPageVisited in the store store.commit(storeMutations.UPDATE_LAST_PAGE_VISITED, to.name); - // router.lastNavigationPage = to.name; - // If saving on navigation is requested, check for saved SessionId or EmailAddress to determine if saving is appropriate if (eval(to.params.isSavingNavigation)) { if (