Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d414207

Browse files
committed
Add root class if user is logged in
1 parent 320f8d7 commit d414207

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

client/src/app/about/about.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
User registration is allowed and
2323

2424
<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.
2626
</ng-template>
2727

2828
<ng-template [ngIf]="userVideoQuota === -1">

client/src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div *ngIf="customCSS" [innerHTML]="customCSS"></div>
22

3-
<div>
3+
<div [ngClass]="{ 'user-logged-in': isUserLoggedIn(), 'user-not-logged-in': !isUserLoggedIn() }">
44
<div class="header">
55

66
<div class="top-left-block" [ngClass]="{ 'border-bottom': isMenuDisplayed === false }">

client/src/app/app.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class AppComponent implements OnInit {
5757

5858
this.authService.loadClientCredentials()
5959

60-
if (this.authService.isLoggedIn()) {
60+
if (this.isUserLoggedIn()) {
6161
// The service will automatically redirect to the login page if the token is not valid anymore
6262
this.authService.refreshUserInformation()
6363
}
@@ -104,6 +104,10 @@ export class AppComponent implements OnInit {
104104
})
105105
}
106106

107+
isUserLoggedIn () {
108+
return this.authService.isLoggedIn()
109+
}
110+
107111
toggleMenu () {
108112
window.scrollTo(0, 0)
109113
this.isMenuDisplayed = !this.isMenuDisplayed

0 commit comments

Comments
 (0)