+ isLoggedIn: boolean;
+
+ constructor(private _friendsService: FriendsService,
+ private _authService: AuthService,
+ private _router: Router
+ ) {
+ if (localStorage.getItem('access_token')) {
+ this.isLoggedIn = true;
+ } else {
+ this.isLoggedIn = false;
+ }
+
+ this._authService.loginChanged$.subscribe(
+ status => {
+ if (status === AuthStatus.LoggedIn) {
+ this.isLoggedIn = true;
+ }
+ }
+ );
+ }