CSR-1439 handle browser navigation

This commit is contained in:
Matt Caimi 2023-06-26 12:25:22 -04:00
parent c7f76b1348
commit cbfd6e49d2

View file

@ -159,8 +159,9 @@ const router = createRouter({
}); });
//---------------------------------------------------------- Router Functions ---------------------------------------------------------- //---------------------------------------------------------- Router Functions ----------------------------------------------------------
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
router.lastNavigationPage = to.name; router.lastNavigationPage = to.name == "root" ? analyticsMixin.methods.getPageName() : to.name;
next(); next();
}); });
@ -168,8 +169,6 @@ router.afterEach(async (to, from) => {
// Update lastPageVisited in the store // Update lastPageVisited in the store
store.commit(storeMutations.UPDATE_LAST_PAGE_VISITED, to.name); 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 saving on navigation is requested, check for saved SessionId or EmailAddress to determine if saving is appropriate
if (eval(to.params.isSavingNavigation)) { if (eval(to.params.isSavingNavigation)) {
if ( if (