Merge pull request #5008 from GabrielInTheWorld/fixUserNoAnonymous

Fixes showing guest, if user is not yet loaded
This commit is contained in:
Emanuel Schütze 2019-09-12 13:11:36 +02:00 committed by GitHub
commit 0ef02c6e87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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