X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Baccounts%2Faccounts.component.ts;h=0033fbf59f37c71bbf2fc563fcbb5f03384fd458;hb=0c302acb3c358b4d4d8dee45aed1de1108ea37ea;hp=3cb117fccaa701daf66bdebe41560c7eb6a636fd;hpb=a2c3564a31268e4e60f05952aa3731e114ac1e30;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index 3cb117fcc..0033fbf59 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts @@ -12,7 +12,7 @@ import { VideoChannelService, VideoService } from '@app/shared/shared-main' -import { AccountReportComponent } from '@app/shared/shared-moderation' +import { AccountReportComponent, BlocklistService } from '@app/shared/shared-moderation' import { HttpStatusCode, User, UserRight } from '@shared/models' @Component({ @@ -30,8 +30,6 @@ export class AccountsComponent implements OnInit, OnDestroy { links: ListOverflowItem[] = [] hideMenu = false - accountFollowerTitle = '' - accountVideosCount: number accountDescriptionHTML = '' accountDescriptionExpanded = false @@ -52,6 +50,7 @@ export class AccountsComponent implements OnInit, OnDestroy { private authService: AuthService, private videoService: VideoService, private markdown: MarkdownService, + private blocklist: BlocklistService, private screenService: ScreenService ) { } @@ -120,12 +119,6 @@ export class AccountsComponent implements OnInit, OnDestroy { this.notifier.success($localize`Username copied`) } - subscribersDisplayFor (count: number) { - if (count === 1) return $localize`1 subscriber` - - return $localize`${count} subscribers` - } - searchChanged (search: string) { const queryParams = { search } @@ -149,9 +142,11 @@ export class AccountsComponent implements OnInit, OnDestroy { } private async onAccount (account: Account) { - this.accountFollowerTitle = $localize`${account.followersCount} direct account followers` - - this.accountDescriptionHTML = await this.markdown.textMarkdownToHTML(account.description) + this.accountDescriptionHTML = await this.markdown.textMarkdownToHTML({ + markdown: account.description, + withEmoji: true, + withHtml: true + }) // After the markdown renderer to avoid layout changes this.account = account @@ -159,10 +154,11 @@ export class AccountsComponent implements OnInit, OnDestroy { this.updateModerationActions() this.loadUserIfNeeded(account) this.loadAccountVideosCount() + this.loadAccountBlockStatus() } private showReportModal () { - this.accountReportModal.show() + this.accountReportModal.show(this.account) } private loadUserIfNeeded (account: Account) { @@ -217,4 +213,9 @@ export class AccountsComponent implements OnInit, OnDestroy { this.accountVideosCount = res.total }) } + + private loadAccountBlockStatus () { + this.blocklist.getStatus({ accounts: [ this.account.nameWithHostForced ], hosts: [ this.account.host ] }) + .subscribe(status => this.account.updateBlockStatus(status)) + } }