From 5378ff9c0fe2b7e75673be3bfd6af47a507f51b7 Mon Sep 17 00:00:00 2001 From: Joe Tannenbaum Date: Mon, 21 Oct 2024 12:23:26 -0400 Subject: [PATCH] fixed method definitions --- packages/core/src/eventHandler.ts | 2 +- packages/core/src/page.ts | 2 +- packages/core/src/router.ts | 2 +- packages/core/src/scroll.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/src/eventHandler.ts b/packages/core/src/eventHandler.ts index a60467383..0c8972723 100644 --- a/packages/core/src/eventHandler.ts +++ b/packages/core/src/eventHandler.ts @@ -72,7 +72,7 @@ class EventHandler { url.hash = window.location.hash history.replaceState({ ...currentPage.get(), url: url.href }) - Scroll.reset(currentPage.get()) + Scroll.reset() return } diff --git a/packages/core/src/page.ts b/packages/core/src/page.ts index c87c17fea..f87e01911 100644 --- a/packages/core/src/page.ts +++ b/packages/core/src/page.ts @@ -80,7 +80,7 @@ class CurrentPage { return this.swap({ component, page, preserveState }).then(() => { if (!preserveScroll) { - Scroll.reset(page) + Scroll.reset() } eventHandler.fireInternalEvent('loadDeferredProps') diff --git a/packages/core/src/router.ts b/packages/core/src/router.ts index 991a32820..00ccd7bfc 100644 --- a/packages/core/src/router.ts +++ b/packages/core/src/router.ts @@ -151,7 +151,7 @@ export class Router { if (!currentPage.isCleared() && !visit.preserveUrl) { // Save scroll regions for the current page - Scroll.save(currentPage.get()) + Scroll.save() } const requestParams: PendingVisit & VisitCallbacks = { diff --git a/packages/core/src/scroll.ts b/packages/core/src/scroll.ts index b810fe000..df1bb51be 100644 --- a/packages/core/src/scroll.ts +++ b/packages/core/src/scroll.ts @@ -1,5 +1,5 @@ import { history } from './history' -import { Page, ScrollRegion } from './types' +import { ScrollRegion } from './types' export class Scroll { public static save(): void { @@ -15,7 +15,7 @@ export class Scroll { return document.querySelectorAll('[scroll-region]') } - public static reset(page: Page): void { + public static reset(): void { if (typeof window !== 'undefined') { window.scrollTo(0, 0) }