1
0
Fork 0

chore: reduce nesting

This commit is contained in:
kolaente 2023-04-01 14:19:28 +02:00
parent a7fdec956f
commit e8cb7c1083
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 8 additions and 11 deletions

View File

@ -532,17 +532,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, ''),
},
}
}