aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-27 16:18:25 +0200
committerChocobozzz <me@florianbigard.com>2018-03-27 16:18:49 +0200
commitd414207f07f47307947d86d5bc5c5fc0ae73be18 (patch)
treecd7c645c644a3db29a759638fb554694f766b742 /client/src
parent320f8d7e01eea760ceb8b71727694912eeebd0dc (diff)
downloadPeerTube-d414207f07f47307947d86d5bc5c5fc0ae73be18.tar.gz
PeerTube-d414207f07f47307947d86d5bc5c5fc0ae73be18.tar.zst
PeerTube-d414207f07f47307947d86d5bc5c5fc0ae73be18.zip
Add root class if user is logged in
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/about/about.component.html2
-rw-r--r--client/src/app/app.component.html2
-rw-r--r--client/src/app/app.component.ts6
3 files changed, 7 insertions, 3 deletions
diff --git a/client/src/app/about/about.component.html b/client/src/app/about/about.component.html
index bad90d161..bc6a8c6f3 100644
--- a/client/src/app/about/about.component.html
+++ b/client/src/app/about/about.component.html
@@ -22,7 +22,7 @@
22 User registration is allowed and 22 User registration is allowed and
23 23
24 <ng-template [ngIf]="userVideoQuota !== -1"> 24 <ng-template [ngIf]="userVideoQuota !== -1">
25 this instance provides a baseline quota of {{ userVideoQuota | bytes }} space for the videos of its users. 25 this instance provides a baseline quota of {{ userVideoQuota | bytes: 0 }} space for the videos of its users.
26 </ng-template> 26 </ng-template>
27 27
28 <ng-template [ngIf]="userVideoQuota === -1"> 28 <ng-template [ngIf]="userVideoQuota === -1">
diff --git a/client/src/app/app.component.html b/client/src/app/app.component.html
index 06aca9bcd..a7128d4fa 100644
--- a/client/src/app/app.component.html
+++ b/client/src/app/app.component.html
@@ -1,6 +1,6 @@
1<div *ngIf="customCSS" [innerHTML]="customCSS"></div> 1<div *ngIf="customCSS" [innerHTML]="customCSS"></div>
2 2
3<div> 3<div [ngClass]="{ 'user-logged-in': isUserLoggedIn(), 'user-not-logged-in': !isUserLoggedIn() }">
4 <div class="header"> 4 <div class="header">
5 5
6 <div class="top-left-block" [ngClass]="{ 'border-bottom': isMenuDisplayed === false }"> 6 <div class="top-left-block" [ngClass]="{ 'border-bottom': isMenuDisplayed === false }">
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index 0ea3c1389..18115ae75 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -57,7 +57,7 @@ export class AppComponent implements OnInit {
57 57
58 this.authService.loadClientCredentials() 58 this.authService.loadClientCredentials()
59 59
60 if (this.authService.isLoggedIn()) { 60 if (this.isUserLoggedIn()) {
61 // The service will automatically redirect to the login page if the token is not valid anymore 61 // The service will automatically redirect to the login page if the token is not valid anymore
62 this.authService.refreshUserInformation() 62 this.authService.refreshUserInformation()
63 } 63 }
@@ -104,6 +104,10 @@ export class AppComponent implements OnInit {
104 }) 104 })
105 } 105 }
106 106
107 isUserLoggedIn () {
108 return this.authService.isLoggedIn()
109 }
110
107 toggleMenu () { 111 toggleMenu () {
108 window.scrollTo(0, 0) 112 window.scrollTo(0, 0)
109 this.isMenuDisplayed = !this.isMenuDisplayed 113 this.isMenuDisplayed = !this.isMenuDisplayed