From dcb7e1ecf479a72c904dd882c05f1c446dbe2fe4 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 00:32:25 +0100 Subject: [PATCH] Add option for disabling counts (followers, statuses) in user profiles. --- src/components/settings/settings.js | 4 ++++ src/components/settings/settings.vue | 4 ++++ src/components/user_card_content/user_card_content.js | 5 +++++ src/components/user_card_content/user_card_content.vue | 10 +++++----- src/i18n/messages.js | 1 + src/main.js | 1 + src/modules/config.js | 1 + 7 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index de12894b..088e19d3 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -10,6 +10,7 @@ const settings = { hideAttachmentsLocal: this.$store.state.config.hideAttachments, hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv, hideNsfwLocal: this.$store.state.config.hideNsfw, + hideUserStatsLocal: this.$store.state.config.hideUserStats, notificationVisibilityLocal: this.$store.state.config.notificationVisibility, replyVisibilityLocal: this.$store.state.config.replyVisibility, loopVideoLocal: this.$store.state.config.loopVideo, @@ -47,6 +48,9 @@ const settings = { hideAttachmentsInConvLocal (value) { this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value }) }, + hideUserStatsLocal (value) { + this.$store.dispatch('setOption', { name: 'hideUserStats', value }) + }, hideNsfwLocal (value) { this.$store.dispatch('setOption', { name: 'hideNsfw', value }) }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index c106b79c..2cf62200 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -122,6 +122,10 @@ +
+ + +

{{$t('settings.filtering_explanation')}}

diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js index 76a5577e..eefa65f3 100644 --- a/src/components/user_card_content/user_card_content.js +++ b/src/components/user_card_content/user_card_content.js @@ -3,6 +3,11 @@ import { hex2rgb } from '../../services/color_convert/color_convert.js' export default { props: [ 'user', 'switcher', 'selected', 'hideBio' ], + data () { + return { + hideUserStatsLocal: this.$store.state.config.hideUserStats + } + }, computed: { headingStyle () { const color = this.$store.state.config.colors.bg diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 59358040..65fd26eb 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -17,7 +17,7 @@
{{user.name}}
@{{user.screen_name}} - {{dailyAvg}} {{ $t('user_card.per_day') }} + {{dailyAvg}} {{ $t('user_card.per_day') }}
@@ -90,19 +90,19 @@ -
+
{{ $t('user_card.statuses') }}
- {{user.statuses_count}}
+ {{user.statuses_count}}
{{ $t('user_card.followees') }}
- {{user.friends_count}} + {{user.friends_count}}
{{ $t('user_card.followers') }}
- {{user.followers_count}} + {{user.followers_count}}

diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 42e7e9d4..42b1dd40 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -328,6 +328,7 @@ const en = { loop_video_silent_only: 'Loop only videos without sound (i.e. Mastodon\'s "gifs")', reply_link_preview: 'Enable reply-link preview on mouse hover', replies_in_timeline: 'Replies in timeline', + hide_user_stats: 'Hide user statistics (e.g. status and follower counts)', reply_visibility_all: 'Show all replies', reply_visibility_following: 'Only show replies directed at me or users I\'m following', reply_visibility_self: 'Only show replies directed at me', diff --git a/src/main.js b/src/main.js index debd8703..d05ecba8 100644 --- a/src/main.js +++ b/src/main.js @@ -48,6 +48,7 @@ const persistedStateOptions = { 'config.collapseMessageWithSubject', 'config.hideAttachments', 'config.hideAttachmentsInConv', + 'config.hideUserStats', 'config.hideNsfw', 'config.replyVisibility', 'config.notificationVisibility', diff --git a/src/modules/config.js b/src/modules/config.js index 60a34bc1..24665e95 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -9,6 +9,7 @@ const defaultState = { collapseMessageWithSubject: false, hideAttachments: false, hideAttachmentsInConv: false, + hideUserStats: false, hideNsfw: true, loopVideo: true, loopVideoSilentOnly: true,