diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-27 16:18:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-27 16:18:49 +0200 |
commit | d414207f07f47307947d86d5bc5c5fc0ae73be18 (patch) | |
tree | cd7c645c644a3db29a759638fb554694f766b742 /client/src/app/app.component.ts | |
parent | 320f8d7e01eea760ceb8b71727694912eeebd0dc (diff) | |
download | PeerTube-d414207f07f47307947d86d5bc5c5fc0ae73be18.tar.gz PeerTube-d414207f07f47307947d86d5bc5c5fc0ae73be18.tar.zst PeerTube-d414207f07f47307947d86d5bc5c5fc0ae73be18.zip |
Add root class if user is logged in
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r-- | client/src/app/app.component.ts | 6 |
1 files changed, 5 insertions, 1 deletions
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 |