aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-01 13:57:29 +0100
committerChocobozzz <me@florianbigard.com>2018-03-01 13:57:29 +0100
commit901637bb87f5eb0518fb7ca69d98b53ed918339e (patch)
treea8e8943fef7a109ba269d33029174cbdf4dde6d2 /client/src/app/app.component.ts
parenta73c582e5b6f5c52427b38aaf55b3afbead24053 (diff)
downloadPeerTube-901637bb87f5eb0518fb7ca69d98b53ed918339e.tar.gz
PeerTube-901637bb87f5eb0518fb7ca69d98b53ed918339e.tar.zst
PeerTube-901637bb87f5eb0518fb7ca69d98b53ed918339e.zip
Add ability to change the homepage
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r--client/src/app/app.component.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index 25936146c..346e966e5 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -1,7 +1,7 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { DomSanitizer, SafeHtml } from '@angular/platform-browser' 2import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
3import { GuardsCheckStart, Router } from '@angular/router' 3import { GuardsCheckStart, Router } from '@angular/router'
4import { AuthService, ServerService } from '@app/core' 4import { AuthService, RedirectService, ServerService } from '@app/core'
5import { isInSmallView } from '@app/shared/misc/utils' 5import { isInSmallView } from '@app/shared/misc/utils'
6 6
7@Component({ 7@Component({
@@ -31,7 +31,8 @@ export class AppComponent implements OnInit {
31 private router: Router, 31 private router: Router,
32 private authService: AuthService, 32 private authService: AuthService,
33 private serverService: ServerService, 33 private serverService: ServerService,
34 private domSanitizer: DomSanitizer 34 private domSanitizer: DomSanitizer,
35 private redirectService: RedirectService
35 ) {} 36 ) {}
36 37
37 get serverVersion () { 38 get serverVersion () {
@@ -43,6 +44,10 @@ export class AppComponent implements OnInit {
43 } 44 }
44 45
45 ngOnInit () { 46 ngOnInit () {
47 if (this.router.url === '/') {
48 this.redirectService.redirectToHomepage()
49 }
50
46 this.authService.loadClientCredentials() 51 this.authService.loadClientCredentials()
47 52
48 if (this.authService.isLoggedIn()) { 53 if (this.authService.isLoggedIn()) {