aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-31 18:12:15 +0200
committerChocobozzz <me@florianbigard.com>2018-06-05 08:43:01 +0200
commit989e526abf0c0dd7958deb630df009608561bb67 (patch)
tree5d948bf953a7006b1d6b8c34fb03da1df612a50f /client/src/app/app.component.ts
parent1dd59831f80ff4d49f3b60c8c3b2aabfb1512eeb (diff)
downloadPeerTube-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.ts7
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 @@
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, NavigationEnd } from '@angular/router' 3import { GuardsCheckStart, NavigationEnd, Router } from '@angular/router'
4import { AuthService, RedirectService, 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'
6import { 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 }