Revert "Fix RVO redirect URL for locale (without loosing queryparms)"

This reverts commit df14427d604ed254908c9192f5789e2ba924660d.
This commit is contained in:
Peter (extern) 2025-03-12 15:37:59 +01:00
parent 78249811ab
commit 9f43287433

View File

@ -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});