forked from Mirrors/elk
chore: simplify logic
This commit is contained in:
parent
9bc00be29a
commit
1241921435
1 changed files with 8 additions and 13 deletions
|
@ -33,20 +33,15 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||
return
|
||||
}
|
||||
|
||||
if (!route.meta || !route.meta?.noScrollTrack) {
|
||||
const r = ignoreCustomRoutes ? undefined : customRoutes.has(route.fullPath)
|
||||
if (r) {
|
||||
reject(new Error('custom routed detected'))
|
||||
return
|
||||
}
|
||||
const r = ignoreCustomRoutes ? undefined : customRoutes.has(route.fullPath)
|
||||
if (r) {
|
||||
reject(new Error('custom routed detected'))
|
||||
return
|
||||
}
|
||||
|
||||
const scrollPosition = storage.value[route.fullPath]
|
||||
if (scrollPosition)
|
||||
window.scrollTo(0, scrollPosition)
|
||||
}
|
||||
else {
|
||||
forceScroll()
|
||||
}
|
||||
const scrollPosition = storage.value[route.fullPath]
|
||||
if (scrollPosition)
|
||||
window.scrollTo(0, scrollPosition)
|
||||
|
||||
resolve()
|
||||
}, 600)
|
||||
|
|
Loading…
Reference in a new issue