From 9ab6d75592f309d2d19d8e1f4fe7c8beb85c3224 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:27:41 +0530 Subject: [PATCH] adjust --- src/client/app/router.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 83faca5c..caf36a2d 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -84,11 +84,11 @@ export function createRouter( { smoothScroll = false, initialLoad = false } = {} ) { href = normalizeHref(href) - const loc = inBrowser ? normalizeHref(location.href) : null - if ((await router.onBeforeRouteChange?.(href)) === false) return - if (loc !== null) { + if (inBrowser) { + const loc = normalizeHref(location.href) + const { pathname, hash } = new URL(href, fakeHost) const currentLoc = new URL(loc, fakeHost)