]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+accounts/account-about/account-about.component.ts
Fix player resolution change that plays even if the video was paused
[github/Chocobozzz/PeerTube.git] / client / src / app / +accounts / account-about / account-about.component.ts
1 import { Component, OnInit, OnDestroy } from '@angular/core'
2 import { ActivatedRoute } from '@angular/router'
3 import { Account } from '@app/shared/account/account.model'
4 import { AccountService } from '@app/shared/account/account.service'
5 import { I18n } from '@ngx-translate/i18n-polyfill'
6 import { Subscription } from 'rxjs'
7
8 @Component({
9 selector: 'my-account-about',
10 templateUrl: './account-about.component.html',
11 styleUrls: [ './account-about.component.scss' ]
12 })
13 export class AccountAboutComponent implements OnInit, OnDestroy {
14 account: Account
15
16 private accountSub: Subscription
17
18 constructor (
19 private route: ActivatedRoute,
20 private i18n: I18n,
21 private accountService: AccountService
22 ) { }
23
24 ngOnInit () {
25 // Parent get the account for us
26 this.accountSub = this.accountService.accountLoaded
27 .subscribe(account => this.account = account)
28 }
29
30 ngOnDestroy () {
31 if (this.accountSub) this.accountSub.unsubscribe()
32 }
33
34 getAccountDescription () {
35 if (this.account.description) return this.account.description
36
37 return this.i18n('No description')
38 }
39 }