From 6539eb7225e9650e862af0295d11cca4662d4b5d Mon Sep 17 00:00:00 2001 From: Benjamin Pabst Date: Mon, 4 Nov 2024 08:18:20 +0100 Subject: [PATCH] fix: use replaceUrl for first navigate in router connector --- .../src/lib/utils/webcomponent-bootstrap.utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts b/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts index cf7011fec..5095f15c3 100644 --- a/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts +++ b/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts @@ -165,7 +165,9 @@ function connectMicroFrontendRouter(injector: Injector, warn = true): Subscripti function connectRouter(router: Router): Subscription { const initialUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}${location.hash}` - router.navigateByUrl(initialUrl) + router.navigateByUrl(initialUrl, { + replaceUrl: true, + }) let lastUrl = initialUrl const observer = new EventsTopic() return observer.pipe(filter((e) => e.type === 'navigated')).subscribe(() => {