From f3a8778ede8395e32c8c6295896e074a742d759a Mon Sep 17 00:00:00 2001 From: userquin Date: Sat, 11 Feb 2023 12:42:01 +0100 Subject: [PATCH] chore: expose only required methods --- plugins/track-scroll-position.client.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/track-scroll-position.client.ts b/plugins/track-scroll-position.client.ts index c88332a8..c581e1a6 100644 --- a/plugins/track-scroll-position.client.ts +++ b/plugins/track-scroll-position.client.ts @@ -43,7 +43,8 @@ export default defineNuxtPlugin((nuxtApp) => { if (scrollPosition) window.scrollTo(0, scrollPosition) - // required for custom routes: first call will reject + // required for custom routes: first call will be rejected + // we need to enable scroll tracking again, it is disabled if (!track.value) { nextTick().then(() => { track.value = true @@ -82,12 +83,11 @@ export default defineNuxtPlugin((nuxtApp) => { return { provide: { - trackScroll: reactive({ + trackScroll: { forceScrollToTop, - restoreScroll, registerCustomRoute, restoreCustomPageScroll, - }), + }, }, } })