diff options
| author | eugenijm <eugenijm@protonmail.com> | 2019-02-04 18:05:56 +0300 |
|---|---|---|
| committer | eugenijm <eugenijm@protonmail.com> | 2019-02-06 18:07:37 +0300 |
| commit | d00b74b607f5bf77a7c695262d9690c2f5d31023 (patch) | |
| tree | ae967a422049ac6f5d981e6433ee1fce467e72ca | |
| parent | 648f635429da929e7090b103b9c8d354a1d3860a (diff) | |
Refactor visibleRole for better readability
Improve translation
| -rw-r--r-- | src/components/user_card_content/user_card_content.js | 15 | ||||
| -rw-r--r-- | src/i18n/ru.json | 4 |
2 files changed, 5 insertions, 14 deletions
diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js index 427cb32d..1888f8c6 100644 --- a/src/components/user_card_content/user_card_content.js +++ b/src/components/user_card_content/user_card_content.js @@ -81,19 +81,10 @@ export default { } }, visibleRole () { - const user = this.user + const validRole = (this.user.role === 'admin' || this.user.role === 'moderator') + const showRole = this.isOtherUser || this.user.show_role - if (!(user.role === 'admin' || user.role === 'moderator')) { - return undefined - } - - if (this.isOtherUser) { - return user.role - } - - if (user.show_role) { - return user.role - } + return validRole && showRole && this.user.role } }, components: { diff --git a/src/i18n/ru.json b/src/i18n/ru.json index b5686a5c..4b0bd4b4 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -129,8 +129,8 @@ "no_rich_text_description": "Убрать форматирование из всех постов", "hide_follows_description": "Не показывать кого я читаю", "hide_followers_description": "Не показывать кто читает меня", - "show_admin_badge": "Показывать значок администратора на моей карточке пользователя", - "show_moderator_badge": "Показывать значок модератора на моей карточке пользователя", + "show_admin_badge": "Показывать значок администратора в моем профиле", + "show_moderator_badge": "Показывать значок модератора в моем профиле", "nsfw_clickthrough": "Включить скрытие NSFW вложений", "panelRadius": "Панели", "pause_on_unfocused": "Приостановить загрузку когда вкладка не в фокусе", |
