diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-21 10:19:42 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-21 10:19:42 +0200 |
commit | a2c3564a31268e4e60f05952aa3731e114ac1e30 (patch) | |
tree | f0bf29c8b304ec61ded60328f1a488338c2d4c8e /client/src/app/+accounts | |
parent | 5196817c5d7cf86b35f3fa2cfe108ba283944482 (diff) | |
download | PeerTube-a2c3564a31268e4e60f05952aa3731e114ac1e30.tar.gz PeerTube-a2c3564a31268e4e60f05952aa3731e114ac1e30.tar.zst PeerTube-a2c3564a31268e4e60f05952aa3731e114ac1e30.zip |
Improve moderation dropdown UX
Diffstat (limited to 'client/src/app/+accounts')
-rw-r--r-- | client/src/app/+accounts/accounts.component.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index e90816c5a..3cb117fcc 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts | |||
@@ -36,7 +36,7 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
36 | accountDescriptionHTML = '' | 36 | accountDescriptionHTML = '' |
37 | accountDescriptionExpanded = false | 37 | accountDescriptionExpanded = false |
38 | 38 | ||
39 | prependModerationActions: DropdownAction<any>[] | 39 | prependModerationActions: DropdownAction<any>[] = [] |
40 | 40 | ||
41 | private routeSub: Subscription | 41 | private routeSub: Subscription |
42 | 42 | ||
@@ -151,8 +151,6 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
151 | private async onAccount (account: Account) { | 151 | private async onAccount (account: Account) { |
152 | this.accountFollowerTitle = $localize`${account.followersCount} direct account followers` | 152 | this.accountFollowerTitle = $localize`${account.followersCount} direct account followers` |
153 | 153 | ||
154 | this.prependModerationActions = undefined | ||
155 | |||
156 | this.accountDescriptionHTML = await this.markdown.textMarkdownToHTML(account.description) | 154 | this.accountDescriptionHTML = await this.markdown.textMarkdownToHTML(account.description) |
157 | 155 | ||
158 | // After the markdown renderer to avoid layout changes | 156 | // After the markdown renderer to avoid layout changes |
@@ -184,6 +182,8 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
184 | } | 182 | } |
185 | 183 | ||
186 | private updateModerationActions () { | 184 | private updateModerationActions () { |
185 | this.prependModerationActions = [] | ||
186 | |||
187 | if (!this.authService.isLoggedIn()) return | 187 | if (!this.authService.isLoggedIn()) return |
188 | 188 | ||
189 | this.authService.userInformationLoaded.subscribe( | 189 | this.authService.userInformationLoaded.subscribe( |
@@ -193,6 +193,10 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
193 | // It's not our account, we can report it | 193 | // It's not our account, we can report it |
194 | this.prependModerationActions = [ | 194 | this.prependModerationActions = [ |
195 | { | 195 | { |
196 | label: $localize`Report`, | ||
197 | isHeader: true | ||
198 | }, | ||
199 | { | ||
196 | label: $localize`Report this account`, | 200 | label: $localize`Report this account`, |
197 | handler: () => this.showReportModal() | 201 | handler: () => this.showReportModal() |
198 | } | 202 | } |