perf: misc performance improvements

This commit is contained in:
Jannat Patel
2025-01-17 17:17:02 +05:30
parent 58abfd004d
commit 145342bb72
10 changed files with 62 additions and 97 deletions

View File

@@ -217,21 +217,13 @@ let router = createRouter({
})
router.beforeEach(async (to, from, next) => {
const { userResource, allUsers } = usersStore()
const { userResource } = usersStore()
let { isLoggedIn } = sessionStore()
try {
if (isLoggedIn) {
await userResource.promise
}
if (
isLoggedIn &&
(to.name == 'Lesson' ||
to.name == 'Batch' ||
to.name == 'Notifications')
) {
await allUsers.promise
}
} catch (error) {
isLoggedIn = false
}