chore: do not apply timeout on pages without scroll tracking

This commit is contained in:
userquin 2023-02-10 22:34:34 +01:00
parent a7414bb59e
commit 3e0b2a3e4b

View file

@ -20,6 +20,11 @@ export default defineNuxtPlugin((nuxtApp) => {
const restoreScroll = () => {
const path = route.fullPath
return nextTick().then(() => {
if (route.meta && route.meta?.noScrollTrack) {
forceScroll()
return Promise.resolve()
}
return new Promise<void>((resolve, reject) => {
setTimeout(() => {
if (path !== route.fullPath) {