1
0

chore: reduce nesting

This commit is contained in:
kolaente 2023-04-01 14:19:28 +02:00
parent 7c964c29d4
commit 06a1ff6f4b
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B

View File

@ -490,9 +490,7 @@ router.beforeEach(async (to, from) => {
to.hash = from.hash
}
if (to.hash.startsWith(LINK_SHARE_HASH_PREFIX)) {
const currentAuthToken = getToken()
if (currentAuthToken === null) {
if (to.hash.startsWith(linkShareHashPrefix) && getToken() === null) {
saveLastVisited(to.name as string, to.params, to.query)
return {
name: 'link-share.auth',
@ -501,7 +499,6 @@ router.beforeEach(async (to, from) => {
},
}
}
}
const newRoute = await getAuthForRoute(to)
if(newRoute) {