chore: reduce nesting
This commit is contained in:
parent
7c964c29d4
commit
06a1ff6f4b
@ -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, ''),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user