From 9bc00be29ad20aa2b910536c58fd0338a5be008c Mon Sep 17 00:00:00 2001 From: userquin Date: Sat, 11 Feb 2023 00:15:57 +0100 Subject: [PATCH] chore: refactor some names --- plugins/track-scroll-position.client.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/track-scroll-position.client.ts b/plugins/track-scroll-position.client.ts index 6fb00e84..fa37e006 100644 --- a/plugins/track-scroll-position.client.ts +++ b/plugins/track-scroll-position.client.ts @@ -18,10 +18,10 @@ export default defineNuxtPlugin((nuxtApp) => { window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }) } - const restoreScrollCallback = (ignoreHook: boolean) => { + const restoreScrollCallback = (ignoreCustomRoutes: boolean) => { const path = route.fullPath return nextTick().then(() => { - if (route.meta && route.meta?.noScrollTrack) { + if (route.meta?.noScrollTrack) { forceScroll() return Promise.resolve() } @@ -34,9 +34,9 @@ export default defineNuxtPlugin((nuxtApp) => { } if (!route.meta || !route.meta?.noScrollTrack) { - const hook = ignoreHook ? undefined : customRoutes.has(route.fullPath) - if (hook) { - reject(new Error('hook detected')) + const r = ignoreCustomRoutes ? undefined : customRoutes.has(route.fullPath) + if (r) { + reject(new Error('custom routed detected')) return }