Fix RVO redirect URL for locale (without loosing queryparms)
This commit is contained in:
parent
b2fe8f3bd7
commit
df14427d60
@ -1,18 +1,18 @@
|
|||||||
import { Injectable, Inject, LOCALE_ID } from '@angular/core';
|
import { Inject, Injectable, LOCALE_ID } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { OAuthService,UserInfo } from 'angular-oauth2-oidc';
|
import { Actions, createEffect, ofType } from '@ngrx/effects';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { Actions,ofType,createEffect } from '@ngrx/effects';
|
import { OAuthService, UserInfo } from 'angular-oauth2-oidc';
|
||||||
import { of,from,zip } from 'rxjs';
|
import { from, of, zip } from 'rxjs';
|
||||||
import { withLatestFrom,mergeMap,switchMap,map,catchError,first} from 'rxjs/operators';
|
import { catchError, first, map, mergeMap, switchMap, withLatestFrom } from 'rxjs/operators';
|
||||||
import * as appCommonActions from '../actions/app-common.actions';
|
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 { IItemTypes } from '../models/item.types';
|
||||||
import { IListItem } from '../models/list.item';
|
import { IListItem } from '../models/list.item';
|
||||||
import {StateSerializerService} from '../services/state-serializer.service';
|
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';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppCommonEffects {
|
export class AppCommonEffects {
|
||||||
@ -63,9 +63,9 @@ 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;
|
||||||
if (location.pathname.includes(`/${this.locale}/`)) {
|
if (this.router$.url.includes(`/${this.locale}/`)) {
|
||||||
const newPath = location.pathname.replace(`/${this.locale}/`, `/${a.locale}/`);
|
const newUrl = this.router$.url.replace(`/${this.locale}/`, `/${a.locale}/`);
|
||||||
location.replace(newPath);
|
this.router$.navigateByUrl(newUrl);
|
||||||
}
|
}
|
||||||
return of(undefined);
|
return of(undefined);
|
||||||
})),{ dispatch:false});
|
})),{ dispatch:false});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user