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 import { MarkdownService } from '@app/videos/shared'
10 selector: 'my-account-about',
11 templateUrl: './account-about.component.html',
12 styleUrls: [ './account-about.component.scss' ]
14 export class AccountAboutComponent implements OnInit, OnDestroy {
18 private accountSub: Subscription
21 private route: ActivatedRoute,
23 private accountService: AccountService,
24 private markdownService: MarkdownService
28 // Parent get the account for us
29 this.accountSub = this.accountService.accountLoaded
30 .subscribe(account => {
31 this.account = account
32 this.descriptionHTML = this.markdownService.textMarkdownToHTML(this.account.description)
37 if (this.accountSub) this.accountSub.unsubscribe()
40 getAccountDescription () {
41 if (this.descriptionHTML) return this.descriptionHTML
43 return this.i18n('No description')