diff options
| author | eugenijm <eugenijm@protonmail.com> | 2019-02-04 17:03:35 +0300 |
|---|---|---|
| committer | eugenijm <eugenijm@protonmail.com> | 2019-02-06 18:07:10 +0300 |
| commit | 648f635429da929e7090b103b9c8d354a1d3860a (patch) | |
| tree | 2f3f564f374f81a7b2ef7933d4b3d8f247d1cd72 /src/components/user_card_content/user_card_content.js | |
| parent | c714eb26002b1343a64d664ad7c1282f838f39aa (diff) | |
Allow to configure visibility for admin and moderator badges
Diffstat (limited to 'src/components/user_card_content/user_card_content.js')
| -rw-r--r-- | src/components/user_card_content/user_card_content.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js index 6f6d04a7..427cb32d 100644 --- a/src/components/user_card_content/user_card_content.js +++ b/src/components/user_card_content/user_card_content.js @@ -79,6 +79,21 @@ export default { set (color) { this.$store.dispatch('setHighlight', { user: this.user.screen_name, color }) } + }, + visibleRole () { + const user = this.user + + if (!(user.role === 'admin' || user.role === 'moderator')) { + return undefined + } + + if (this.isOtherUser) { + return user.role + } + + if (user.show_role) { + return user.role + } } }, components: { |
