Fixes showing guest, if user is not yet loaded

This commit is contained in:
GabrielMeyer 2019-09-12 12:45:08 +02:00
parent b0460931bb
commit 07d84759c3
1 changed files with 7 additions and 2 deletions

View File

@ -106,8 +106,13 @@ export class SiteComponent extends BaseComponent implements OnInit {
overlayService.setSpinner(true, translate.instant('Loading data. Please wait...'));
this.operator.getViewUserObservable().subscribe(user => {
this.username = user ? user.short_name : translate.instant('Guest');
this.isLoggedIn = !!user;
if (!operator.isAnonymous) {
this.username = user ? user.short_name : '';
this.isLoggedIn = true;
} else {
this.username = translate.instant('Guest');
this.isLoggedIn = false;
}
});
offlineService.isOffline().subscribe(offline => {