Browse Source

Minor improvement

pull/117/head
Thomas 4 years ago
parent
commit
807ee0486a
  1. 8
      apps/client/src/app/app.component.ts
  2. 2
      apps/client/src/app/services/user/user.service.ts

8
apps/client/src/app/app.component.ts

@ -31,7 +31,6 @@ export class AppComponent implements OnDestroy, OnInit {
public currentYear = new Date().getFullYear();
public deviceType: string;
public info: InfoItem;
public isLoggedIn = false;
public user: User;
public version = environment.version;
@ -76,9 +75,12 @@ export class AppComponent implements OnDestroy, OnInit {
this.user.permissions,
permissions.createUserAccount
);
this.cd.markForCheck();
} else if (!this.tokenStorageService.getToken()) {
// User has not been logged in
this.user = null;
}
this.cd.markForCheck();
});
}

2
apps/client/src/app/services/user/user.service.ts

@ -16,7 +16,7 @@ export class UserService extends ObservableStore<UserStoreState> {
public constructor(private http: HttpClient) {
super({ trackStateHistory: true });
this.setState({ user: null }, 'INIT_STATE');
this.setState({ user: undefined }, 'INIT_STATE');
}
public get() {

Loading…
Cancel
Save