diff options
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r-- | client/src/app/app.component.ts | 9 |
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 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' | 2 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' |
3 | import { GuardsCheckStart, Router } from '@angular/router' | 3 | import { GuardsCheckStart, Router } from '@angular/router' |
4 | import { AuthService, ServerService } from '@app/core' | 4 | import { AuthService, RedirectService, ServerService } from '@app/core' |
5 | import { isInSmallView } from '@app/shared/misc/utils' | 5 | import { 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()) { |