From 5daaf7cca7b8930b42ee59c0eb57c7897fec55e6 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Thu, 23 Jan 2025 01:09:20 +0530 Subject: [PATCH] . --- src/client/app/router.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 676f4b3cc3da..8c783139b6de 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -72,11 +72,11 @@ export function createRouter( } async function go(href: string = inBrowser ? location.href : '/') { - if ((await router.onBeforeRouteChange?.(href)) === false) return - href = normalizeHref(href) const loc = inBrowser ? normalizeHref(location.href) : null + if ((await router.onBeforeRouteChange?.(href)) === false) return + if (loc !== null && href !== loc) { const { pathname, hash } = new URL(href, fakeHost) const currentLoc = new URL(loc, fakeHost)