From 9f4328743313ee27c7244a1528d85e5be272e7c4 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Wed, 12 Mar 2025 15:37:59 +0100 Subject: [PATCH] Revert "Fix RVO redirect URL for locale (without loosing queryparms)" This reverts commit df14427d604ed254908c9192f5789e2ba924660d. --- .../src/fm/effects/app-common.effects.ts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/projects/common/src/fm/effects/app-common.effects.ts b/projects/common/src/fm/effects/app-common.effects.ts index 992b026..b849f87 100644 --- a/projects/common/src/fm/effects/app-common.effects.ts +++ b/projects/common/src/fm/effects/app-common.effects.ts @@ -1,18 +1,18 @@ -import { Inject, Injectable, LOCALE_ID } from '@angular/core'; +import { Injectable, Inject, LOCALE_ID } from '@angular/core'; import { Router } from '@angular/router'; -import { Actions, createEffect, ofType } from '@ngrx/effects'; +import { OAuthService,UserInfo } from 'angular-oauth2-oidc'; import { Store } from '@ngrx/store'; -import { OAuthService, UserInfo } from 'angular-oauth2-oidc'; -import { from, of, zip } from 'rxjs'; -import { catchError, first, map, mergeMap, switchMap, withLatestFrom } from 'rxjs/operators'; +import { Actions,ofType,createEffect } from '@ngrx/effects'; +import { of,from,zip } from 'rxjs'; +import { withLatestFrom,mergeMap,switchMap,map,catchError,first} from 'rxjs/operators'; import * as appCommonActions from '../actions/app-common.actions'; +import * as appCommonReducers from '../reducers/app-common.reducer'; +import { ItemService } from '../services/item.service'; +import { FolderService } from '../services/folder.service'; +import { UserService } from '../services/user.service'; import { IItemTypes } from '../models/item.types'; import { IListItem } from '../models/list.item'; -import * as appCommonReducers from '../reducers/app-common.reducer'; -import { FolderService } from '../services/folder.service'; -import { ItemService } from '../services/item.service'; -import { StateSerializerService } from '../services/state-serializer.service'; -import { UserService } from '../services/user.service'; +import {StateSerializerService} from '../services/state-serializer.service'; @Injectable() export class AppCommonEffects { @@ -63,9 +63,9 @@ export class AppCommonEffects { ofType(appCommonActions.SWITCHLANGUAGE), switchMap((action) => { const a = action as appCommonActions.SwitchLanguage; - if (this.router$.url.includes(`/${this.locale}/`)) { - const newUrl = this.router$.url.replace(`/${this.locale}/`, `/${a.locale}/`); - this.router$.navigateByUrl(newUrl); + if (location.pathname.includes(`/${this.locale}/`)) { + const newPath = location.pathname.replace(`/${this.locale}/`, `/${a.locale}/`); + location.replace(newPath); } return of(undefined); })),{ dispatch:false});