]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/app.component.ts
Server: add video language attribute
[github/Chocobozzz/PeerTube.git] / client / src / app / app.component.ts
CommitLineData
e2a2d6c8 1import { Component, OnInit, ViewContainerRef } from '@angular/core';
ab32b0fc 2import { Router } from '@angular/router';
dc8bc31b 3
92fb909c 4import { AuthService, ConfigService } from './core';
6e07c3de 5import { VideoService } from './videos';
e2a2d6c8
C
6import { UserService } from './shared';
7
dc8bc31b 8@Component({
3154f382
C
9 selector: 'my-app',
10 templateUrl: './app.component.html',
11 styleUrls: [ './app.component.scss' ]
dc8bc31b 12})
e2a2d6c8 13export class AppComponent implements OnInit {
7ddd02c9
C
14 notificationOptions = {
15 timeOut: 3000,
16 lastOnBottom: true,
17 clickToClose: true,
18 maxLength: 0,
19 maxStack: 7,
20 showProgressBar: false,
21 pauseOnHover: false,
22 preventDuplicates: false,
23 preventLastDuplicates: 'visible',
24 rtl: false
25 };
26
3154f382
C
27 constructor(
28 private router: Router,
e2a2d6c8 29 private authService: AuthService,
92fb909c 30 private configService: ConfigService,
e2a2d6c8 31 private userService: UserService,
6e07c3de 32 private videoService: VideoService,
3154f382
C
33 viewContainerRef: ViewContainerRef
34 ) {}
a99593ed 35
e2a2d6c8
C
36 ngOnInit() {
37 if (this.authService.isLoggedIn()) {
38 // The service will automatically redirect to the login page if the token is not valid anymore
39 this.userService.checkTokenValidity();
40 }
6e07c3de 41
92fb909c 42 this.configService.loadConfig();
6e07c3de 43 this.videoService.loadVideoCategories();
d07137b9 44 this.videoService.loadVideoLicences();
e2a2d6c8
C
45 }
46
beacf699
C
47 isInAdmin() {
48 return this.router.url.indexOf('/admin/') !== -1;
dc8bc31b
C
49 }
50}