mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add root class if user is logged in
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
User registration is allowed and
|
||||
|
||||
<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 [ngIf]="userVideoQuota === -1">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div *ngIf="customCSS" [innerHTML]="customCSS"></div>
|
||||
|
||||
<div>
|
||||
<div [ngClass]="{ 'user-logged-in': isUserLoggedIn(), 'user-not-logged-in': !isUserLoggedIn() }">
|
||||
<div class="header">
|
||||
|
||||
<div class="top-left-block" [ngClass]="{ 'border-bottom': isMenuDisplayed === false }">
|
||||
|
||||
@@ -57,7 +57,7 @@ export class AppComponent implements OnInit {
|
||||
|
||||
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
|
||||
this.authService.refreshUserInformation()
|
||||
}
|
||||
@@ -104,6 +104,10 @@ export class AppComponent implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
isUserLoggedIn () {
|
||||
return this.authService.isLoggedIn()
|
||||
}
|
||||
|
||||
toggleMenu () {
|
||||
window.scrollTo(0, 0)
|
||||
this.isMenuDisplayed = !this.isMenuDisplayed
|
||||
|
||||
Reference in New Issue
Block a user