From b2fe8f3bd714e5afe1aa244cd84035555f0bb69b Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Wed, 12 Mar 2025 14:47:17 +0100 Subject: [PATCH] Fix RVO redirect URL for locale --- projects/common/src/fm/effects/app-common.effects.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/common/src/fm/effects/app-common.effects.ts b/projects/common/src/fm/effects/app-common.effects.ts index 087b423..b849f87 100644 --- a/projects/common/src/fm/effects/app-common.effects.ts +++ b/projects/common/src/fm/effects/app-common.effects.ts @@ -63,7 +63,10 @@ export class AppCommonEffects { ofType(appCommonActions.SWITCHLANGUAGE), switchMap((action) => { const a = action as appCommonActions.SwitchLanguage; - location.replace(`/${a.locale}/`); + if (location.pathname.includes(`/${this.locale}/`)) { + const newPath = location.pathname.replace(`/${this.locale}/`, `/${a.locale}/`); + location.replace(newPath); + } return of(undefined); })),{ dispatch:false});