Add root class if user is logged in

This commit is contained in:
Chocobozzz 2018-03-27 16:18:25 +02:00
parent 320f8d7e01
commit d414207f07
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 7 additions and 3 deletions

View File

@ -22,7 +22,7 @@
User registration is allowed and User registration is allowed and
<ng-template [ngIf]="userVideoQuota !== -1"> <ng-template [ngIf]="userVideoQuota !== -1">
this instance provides a baseline quota of {{ userVideoQuota | bytes }} space for the videos of its users. this instance provides a baseline quota of {{ userVideoQuota | bytes: 0 }} space for the videos of its users.
</ng-template> </ng-template>
<ng-template [ngIf]="userVideoQuota === -1"> <ng-template [ngIf]="userVideoQuota === -1">

View File

@ -1,6 +1,6 @@
<div *ngIf="customCSS" [innerHTML]="customCSS"></div> <div *ngIf="customCSS" [innerHTML]="customCSS"></div>
<div> <div [ngClass]="{ 'user-logged-in': isUserLoggedIn(), 'user-not-logged-in': !isUserLoggedIn() }">
<div class="header"> <div class="header">
<div class="top-left-block" [ngClass]="{ 'border-bottom': isMenuDisplayed === false }"> <div class="top-left-block" [ngClass]="{ 'border-bottom': isMenuDisplayed === false }">

View File

@ -57,7 +57,7 @@ export class AppComponent implements OnInit {
this.authService.loadClientCredentials() this.authService.loadClientCredentials()
if (this.authService.isLoggedIn()) { if (this.isUserLoggedIn()) {
// The service will automatically redirect to the login page if the token is not valid anymore // The service will automatically redirect to the login page if the token is not valid anymore
this.authService.refreshUserInformation() this.authService.refreshUserInformation()
} }
@ -104,6 +104,10 @@ export class AppComponent implements OnInit {
}) })
} }
isUserLoggedIn () {
return this.authService.isLoggedIn()
}
toggleMenu () { toggleMenu () {
window.scrollTo(0, 0) window.scrollTo(0, 0)
this.isMenuDisplayed = !this.isMenuDisplayed this.isMenuDisplayed = !this.isMenuDisplayed