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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!route.meta || !route.meta?.noScrollTrack) {
|
const r = ignoreCustomRoutes ? undefined : customRoutes.has(route.fullPath)
|
||||||
const r = ignoreCustomRoutes ? undefined : customRoutes.has(route.fullPath)
|
if (r) {
|
||||||
if (r) {
|
reject(new Error('custom routed detected'))
|
||||||
reject(new Error('custom routed detected'))
|
return
|
||||||
return
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const scrollPosition = storage.value[route.fullPath]
|
const scrollPosition = storage.value[route.fullPath]
|
||||||
if (scrollPosition)
|
if (scrollPosition)
|
||||||
window.scrollTo(0, scrollPosition)
|
window.scrollTo(0, scrollPosition)
|
||||||
}
|
|
||||||
else {
|
|
||||||
forceScroll()
|
|
||||||
}
|
|
||||||
|
|
||||||
resolve()
|
resolve()
|
||||||
}, 600)
|
}, 600)
|
||||||
|
|
Loading…
Reference in a new issue