feat: notifications
This commit is contained in:
@@ -130,6 +130,11 @@ const routes = [
|
||||
name: 'CertifiedParticipants',
|
||||
component: () => import('@/pages/CertifiedParticipants.vue'),
|
||||
},
|
||||
{
|
||||
path: '/notifications',
|
||||
name: 'Notifications',
|
||||
component: () => import('@/pages/Notifications.vue'),
|
||||
},
|
||||
]
|
||||
|
||||
let router = createRouter({
|
||||
@@ -138,13 +143,21 @@ let router = createRouter({
|
||||
})
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
const { userResource } = usersStore()
|
||||
const { userResource, allUsers } = usersStore()
|
||||
let { isLoggedIn } = sessionStore()
|
||||
|
||||
try {
|
||||
if (isLoggedIn) {
|
||||
await userResource.reload()
|
||||
}
|
||||
if (
|
||||
isLoggedIn &&
|
||||
(to.name == 'Lesson' ||
|
||||
to.name == 'Batch' ||
|
||||
to.name == 'Notifications')
|
||||
) {
|
||||
await allUsers.reload()
|
||||
}
|
||||
} catch (error) {
|
||||
isLoggedIn = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user