[CST-2877] fix method for lang list & add reload after change lang

This commit is contained in:
Danilo Di Nuzzo
2020-06-24 10:55:13 +02:00
parent d66d5b6a46
commit ea5f727449
6 changed files with 95 additions and 40 deletions

View File

@@ -21,7 +21,8 @@ import {
getAuthenticationToken,
getRedirectUrl,
isAuthenticated,
isTokenRefreshing
isTokenRefreshing,
isAuthenticatedLoaded
} from './selectors';
import { AppState, routerStateSelector } from '../../app.reducer';
import {
@@ -148,6 +149,14 @@ export class AuthService {
return this.store.pipe(select(isAuthenticated));
}
/**
* Determines if authentication is loaded
* @returns {Observable<boolean>}
*/
public isAuthenticationLoaded(): Observable<boolean> {
return this.store.pipe(select(isAuthenticatedLoaded));
}
/**
* Returns the href link to authenticated user
* @returns {string}
@@ -197,7 +206,7 @@ export class AuthService {
return this.store.pipe(
select(getAuthenticatedUserId),
hasValueOperator(),
switchMap((id: string) => this.epersonService.findById(id)),
switchMap((id: string) => { console.log('ID: ', id); return this.epersonService.findById(id) }),
getAllSucceededRemoteDataPayload()
)
}