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

@ -489,17 +489,14 @@ router.beforeEach(async (to, from) => {
if(from.hash && from.hash.startsWith(LINK_SHARE_HASH_PREFIX)) { if(from.hash && from.hash.startsWith(LINK_SHARE_HASH_PREFIX)) {
to.hash = from.hash to.hash = from.hash
} }
if (to.hash.startsWith(LINK_SHARE_HASH_PREFIX)) { if (to.hash.startsWith(linkShareHashPrefix) && getToken() === null) {
const currentAuthToken = getToken() saveLastVisited(to.name as string, to.params, to.query)
if (currentAuthToken === null) { return {
saveLastVisited(to.name as string, to.params, to.query) name: 'link-share.auth',
return { params: {
name: 'link-share.auth', share: to.hash.replace(LINK_SHARE_HASH_PREFIX, ''),
params: { },
share: to.hash.replace(LINK_SHARE_HASH_PREFIX, ''),
},
}
} }
} }