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
1 changed files with 8 additions and 11 deletions

View File

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