mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Fixed issue with LocaleInterceptor that blocked new request
This commit is contained in:
@@ -21,8 +21,8 @@ import {
|
||||
getAuthenticationToken,
|
||||
getRedirectUrl,
|
||||
isAuthenticated,
|
||||
isTokenRefreshing,
|
||||
isAuthenticatedLoaded
|
||||
isAuthenticatedLoaded,
|
||||
isTokenRefreshing
|
||||
} from './selectors';
|
||||
import { AppState, routerStateSelector } from '../../app.reducer';
|
||||
import {
|
||||
@@ -34,7 +34,7 @@ import { NativeWindowRef, NativeWindowService } from '../services/window.service
|
||||
import { Base64EncodeUrl } from '../../shared/utils/encode-decode.util';
|
||||
import { RouteService } from '../services/route.service';
|
||||
import { EPersonDataService } from '../eperson/eperson-data.service';
|
||||
import { getAllSucceededRemoteDataPayload } from '../shared/operators';
|
||||
import { getAllSucceededRemoteDataPayload, getFinishedRemoteData, getRemoteDataPayload } from '../shared/operators';
|
||||
import { AuthMethod } from './models/auth.method';
|
||||
|
||||
export const LOGIN_ROUTE = '/login';
|
||||
@@ -206,8 +206,9 @@ export class AuthService {
|
||||
return this.store.pipe(
|
||||
select(getAuthenticatedUserId),
|
||||
hasValueOperator(),
|
||||
switchMap((id: string) => this.epersonService.findById(id) ),
|
||||
getAllSucceededRemoteDataPayload()
|
||||
switchMap((id: string) => this.epersonService.findById(id)),
|
||||
getFinishedRemoteData(),
|
||||
getRemoteDataPayload(),
|
||||
)
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Injectable, Inject } from '@angular/core';
|
||||
import { Inject, Injectable } from '@angular/core';
|
||||
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
@@ -6,9 +6,9 @@ import { isEmpty, isNotEmpty } from '../../shared/empty.util';
|
||||
import { CookieService } from '../services/cookie.service';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { AuthService } from '../auth/auth.service';
|
||||
import { Observable, of as observableOf, combineLatest } from 'rxjs';
|
||||
import { map, take, flatMap } from 'rxjs/operators';
|
||||
import { NativeWindowService, NativeWindowRef } from '../services/window.service';
|
||||
import { combineLatest, Observable, of as observableOf } from 'rxjs';
|
||||
import { flatMap, map, take } from 'rxjs/operators';
|
||||
import { NativeWindowRef, NativeWindowService } from '../services/window.service';
|
||||
|
||||
export const LANG_COOKIE = 'language_cookie';
|
||||
|
||||
@@ -19,7 +19,7 @@ export enum LANG_ORIGIN {
|
||||
UI,
|
||||
EPERSON,
|
||||
BROWSER
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Service to provide localization handler
|
||||
@@ -81,6 +81,7 @@ export class LocaleService {
|
||||
take(1),
|
||||
map((eperson) => {
|
||||
const languages: string[] = [];
|
||||
if (eperson) {
|
||||
const ePersonLang = eperson.firstMetadataValue(this.EPERSON_LANG_METADATA);
|
||||
if (ePersonLang) {
|
||||
languages.push(...this.setQuality(
|
||||
@@ -88,6 +89,7 @@ export class LocaleService {
|
||||
LANG_ORIGIN.EPERSON,
|
||||
!isEmpty(this.translate.currentLang)));
|
||||
}
|
||||
}
|
||||
return languages;
|
||||
})
|
||||
);
|
||||
|
Reference in New Issue
Block a user