1 import { Subscription } from 'rxjs'
2 import { Component, OnDestroy, OnInit } from '@angular/core'
3 import { MarkdownService } from '@app/core'
4 import { Account, AccountService } from '@app/shared/shared-main'
7 selector: 'my-account-about',
8 templateUrl: './account-about.component.html',
9 styleUrls: [ './account-about.component.scss' ]
11 export class AccountAboutComponent implements OnInit, OnDestroy {
15 private accountSub: Subscription
18 private accountService: AccountService,
19 private markdownService: MarkdownService
23 // Parent get the account for us
24 this.accountSub = this.accountService.accountLoaded
25 .subscribe(async account => {
26 this.account = account
27 this.descriptionHTML = await this.markdownService.textMarkdownToHTML(this.account.description, true)
32 if (this.accountSub) this.accountSub.unsubscribe()
35 getAccountDescription () {
36 if (this.descriptionHTML) return this.descriptionHTML
38 return $localize`No description`