From 901637bb87f5eb0518fb7ca69d98b53ed918339e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 1 Mar 2018 13:57:29 +0100 Subject: Add ability to change the homepage --- client/src/app/app.component.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'client/src/app/app.component.ts') 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 @@ import { Component, OnInit } from '@angular/core' import { DomSanitizer, SafeHtml } from '@angular/platform-browser' import { GuardsCheckStart, Router } from '@angular/router' -import { AuthService, ServerService } from '@app/core' +import { AuthService, RedirectService, ServerService } from '@app/core' import { isInSmallView } from '@app/shared/misc/utils' @Component({ @@ -31,7 +31,8 @@ export class AppComponent implements OnInit { private router: Router, private authService: AuthService, private serverService: ServerService, - private domSanitizer: DomSanitizer + private domSanitizer: DomSanitizer, + private redirectService: RedirectService ) {} get serverVersion () { @@ -43,6 +44,10 @@ export class AppComponent implements OnInit { } ngOnInit () { + if (this.router.url === '/') { + this.redirectService.redirectToHomepage() + } + this.authService.loadClientCredentials() if (this.authService.isLoggedIn()) { -- cgit v1.2.3