70373: Store authenticated EPerson ID in store instead of object

This commit is contained in:
Kristof De Langhe
2020-04-15 11:14:41 +02:00
parent 638793ca5e
commit e43aa15a70
8 changed files with 72 additions and 38 deletions

View File

@@ -5,9 +5,10 @@ import { select, Store } from '@ngrx/store';
import { EPerson } from '../../../core/eperson/models/eperson.model';
import { AppState } from '../../../app.reducer';
import { getAuthenticatedUser, isAuthenticationLoading } from '../../../core/auth/selectors';
import { isAuthenticationLoading } from '../../../core/auth/selectors';
import { MYDSPACE_ROUTE } from '../../../+my-dspace-page/my-dspace-page.component';
import { getProfileModulePath } from '../../../app-routing.module';
import { AuthService } from '../../../core/auth/auth.service';
/**
* This component represents the user nav menu.
@@ -42,7 +43,8 @@ export class UserMenuComponent implements OnInit {
*/
public profileRoute = getProfileModulePath();
constructor(private store: Store<AppState>) {
constructor(private store: Store<AppState>,
private authService: AuthService) {
}
/**
@@ -54,7 +56,7 @@ export class UserMenuComponent implements OnInit {
this.loading$ = this.store.pipe(select(isAuthenticationLoading));
// set user
this.user$ = this.store.pipe(select(getAuthenticatedUser));
this.user$ = this.authService.getAuthenticatedUserFromStore();
}
}