diff options
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r-- | client/src/app/app.component.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 0bd127063..6087dbf80 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts | |||
@@ -1,8 +1,9 @@ | |||
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, NavigationEnd } from '@angular/router' | 3 | import { GuardsCheckStart, NavigationEnd, Router } from '@angular/router' |
4 | import { AuthService, RedirectService, 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 | import { is18nPath } from '../../../shared/models/i18n' | ||
6 | 7 | ||
7 | @Component({ | 8 | @Component({ |
8 | selector: 'my-app', | 9 | selector: 'my-app', |
@@ -33,7 +34,7 @@ export class AppComponent implements OnInit { | |||
33 | private serverService: ServerService, | 34 | private serverService: ServerService, |
34 | private domSanitizer: DomSanitizer, | 35 | private domSanitizer: DomSanitizer, |
35 | private redirectService: RedirectService | 36 | private redirectService: RedirectService |
36 | ) {} | 37 | ) { } |
37 | 38 | ||
38 | get serverVersion () { | 39 | get serverVersion () { |
39 | return this.serverService.getConfig().serverVersion | 40 | return this.serverService.getConfig().serverVersion |
@@ -53,7 +54,7 @@ export class AppComponent implements OnInit { | |||
53 | this.router.events.subscribe(e => { | 54 | this.router.events.subscribe(e => { |
54 | if (e instanceof NavigationEnd) { | 55 | if (e instanceof NavigationEnd) { |
55 | const pathname = window.location.pathname | 56 | const pathname = window.location.pathname |
56 | if (!pathname || pathname === '/') { | 57 | if (!pathname || pathname === '/' || is18nPath(pathname)) { |
57 | this.redirectService.redirectToHomepage() | 58 | this.redirectService.redirectToHomepage() |
58 | } | 59 | } |
59 | } | 60 | } |