diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-31 18:12:15 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-05 08:43:01 +0200 |
commit | 989e526abf0c0dd7958deb630df009608561bb67 (patch) | |
tree | 5d948bf953a7006b1d6b8c34fb03da1df612a50f /client/src/app/app.component.ts | |
parent | 1dd59831f80ff4d49f3b60c8c3b2aabfb1512eeb (diff) | |
download | PeerTube-989e526abf0c0dd7958deb630df009608561bb67.tar.gz PeerTube-989e526abf0c0dd7958deb630df009608561bb67.tar.zst PeerTube-989e526abf0c0dd7958deb630df009608561bb67.zip |
Prepare i18n files
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 | } |