Fix RVO redirect URL for locale
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Peter (extern) 2025-03-12 14:47:17 +01:00
parent 3027c69fa8
commit b2fe8f3bd7

View File

@ -63,7 +63,10 @@ export class AppCommonEffects {
ofType(appCommonActions.SWITCHLANGUAGE), ofType(appCommonActions.SWITCHLANGUAGE),
switchMap((action) => { switchMap((action) => {
const a = action as appCommonActions.SwitchLanguage; 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); return of(undefined);
})),{ dispatch:false}); })),{ dispatch:false});