From 50d046ce86cf1aa1aa5ff43e8de79af1088654e0 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 21 Jul 2023 22:33:53 +0200 Subject: [PATCH] Fix URL not updating when using `navigateInternalOnAnchor` We were always calling `replace` and not passing the desired action in the `navigateInternalOnAnchor`, this was leading to the URL not updating when e.g. clicking on file URLs in Markdown renders. By passing the action to the `navigate` fn instead we can also take the `push` action into account. Test have been written to guarantee this works Signed-off-by: Sebastian Martinez --- src/lib/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/router.ts b/src/lib/router.ts index 9dbc1c63d..722c0ed47 100644 --- a/src/lib/router.ts +++ b/src/lib/router.ts @@ -72,7 +72,7 @@ export async function navigateToUrl( const route = urlToRoute(url); if (route) { - await replace(route); + await navigate(action, route); } else { await navigate(action, { resource: "notFound",