diff options
Diffstat (limited to 'client/src/app/+accounts/account-about/account-about.component.ts')
-rw-r--r-- | client/src/app/+accounts/account-about/account-about.component.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/client/src/app/+accounts/account-about/account-about.component.ts b/client/src/app/+accounts/account-about/account-about.component.ts index c0e793754..2acf67a59 100644 --- a/client/src/app/+accounts/account-about/account-about.component.ts +++ b/client/src/app/+accounts/account-about/account-about.component.ts | |||
@@ -4,6 +4,7 @@ import { Account } from '@app/shared/account/account.model' | |||
4 | import { AccountService } from '@app/shared/account/account.service' | 4 | import { AccountService } from '@app/shared/account/account.service' |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { Subscription } from 'rxjs' | 6 | import { Subscription } from 'rxjs' |
7 | import { MarkdownService } from '@app/videos/shared' | ||
7 | 8 | ||
8 | @Component({ | 9 | @Component({ |
9 | selector: 'my-account-about', | 10 | selector: 'my-account-about', |
@@ -12,19 +13,24 @@ import { Subscription } from 'rxjs' | |||
12 | }) | 13 | }) |
13 | export class AccountAboutComponent implements OnInit, OnDestroy { | 14 | export class AccountAboutComponent implements OnInit, OnDestroy { |
14 | account: Account | 15 | account: Account |
16 | descriptionHTML = '' | ||
15 | 17 | ||
16 | private accountSub: Subscription | 18 | private accountSub: Subscription |
17 | 19 | ||
18 | constructor ( | 20 | constructor ( |
19 | private route: ActivatedRoute, | 21 | private route: ActivatedRoute, |
20 | private i18n: I18n, | 22 | private i18n: I18n, |
21 | private accountService: AccountService | 23 | private accountService: AccountService, |
24 | private markdownService: MarkdownService | ||
22 | ) { } | 25 | ) { } |
23 | 26 | ||
24 | ngOnInit () { | 27 | ngOnInit () { |
25 | // Parent get the account for us | 28 | // Parent get the account for us |
26 | this.accountSub = this.accountService.accountLoaded | 29 | this.accountSub = this.accountService.accountLoaded |
27 | .subscribe(account => this.account = account) | 30 | .subscribe(account => { |
31 | this.account = account | ||
32 | this.descriptionHTML = this.markdownService.textMarkdownToHTML(this.account.description) | ||
33 | }) | ||
28 | } | 34 | } |
29 | 35 | ||
30 | ngOnDestroy () { | 36 | ngOnDestroy () { |
@@ -32,7 +38,7 @@ export class AccountAboutComponent implements OnInit, OnDestroy { | |||
32 | } | 38 | } |
33 | 39 | ||
34 | getAccountDescription () { | 40 | getAccountDescription () { |
35 | if (this.account.description) return this.account.description | 41 | if (this.descriptionHTML) return this.descriptionHTML |
36 | 42 | ||
37 | return this.i18n('No description') | 43 | return this.i18n('No description') |
38 | } | 44 | } |