mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 21:43:04 +00:00
Finalized auth module
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { RouterReducerState } from '@ngrx/router-store';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import { fadeInOut, fadeOut } from '../animations/fade';
|
||||
import { CoreState } from '../../core/core.reducers';
|
||||
import { HostWindowService } from '../host-window.service';
|
||||
import { AppState, routerStateSelector } from '../../app.reducer';
|
||||
import { hasValue, isNotUndefined } from '../empty.util';
|
||||
@@ -32,9 +30,8 @@ export class AuthNavMenuComponent implements OnDestroy, OnInit {
|
||||
|
||||
protected subs: Subscription[] = [];
|
||||
|
||||
constructor(
|
||||
private store: Store<AppState>,
|
||||
public windowService: HostWindowService) {
|
||||
constructor(private store: Store<AppState>,
|
||||
public windowService: HostWindowService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -44,7 +41,7 @@ export class AuthNavMenuComponent implements OnDestroy, OnInit {
|
||||
this.user = this.store.select(getAuthenticatedUser);
|
||||
|
||||
this.subs.push(this.store.select(routerStateSelector)
|
||||
.filter((router: RouterReducerState) => isNotUndefined(router))
|
||||
.filter((router: RouterReducerState) => isNotUndefined(router) && isNotUndefined(router.state))
|
||||
.subscribe((router: RouterReducerState) => {
|
||||
this.showAuth = router.state.url !== '/login';
|
||||
}));
|
||||
|
Reference in New Issue
Block a user