1
0
Fork 0
forked from srxl/akkoma-fe

Always show my own followees/followers

This commit is contained in:
taehoon 2019-02-03 12:52:04 -05:00
parent 55fc31ea4d
commit ea1d7f46b5
4 changed files with 16 additions and 4 deletions

View file

@ -79,6 +79,12 @@ export default {
set (color) { set (color) {
this.$store.dispatch('setHighlight', { user: this.user.screen_name, color }) this.$store.dispatch('setHighlight', { user: this.user.screen_name, color })
} }
},
followeesCountVisible () {
return !this.isOtherUser || !this.user.hide_followings
},
followersCountVisible () {
return !this.isOtherUser || !this.user.hide_followers
} }
}, },
components: { components: {

View file

@ -112,11 +112,11 @@
<h5>{{ $t('user_card.statuses') }}</h5> <h5>{{ $t('user_card.statuses') }}</h5>
<span>{{user.statuses_count}} <br></span> <span>{{user.statuses_count}} <br></span>
</div> </div>
<div class="user-count" v-on:click.prevent="setProfileView('friends')" v-if="!user.hide_followings"> <div class="user-count" v-on:click.prevent="setProfileView('friends')" v-if="followeesCountVisible">
<h5>{{ $t('user_card.followees') }}</h5> <h5>{{ $t('user_card.followees') }}</h5>
<span>{{user.friends_count}}</span> <span>{{user.friends_count}}</span>
</div> </div>
<div class="user-count" v-on:click.prevent="setProfileView('followers')" v-if="!user.hide_followers"> <div class="user-count" v-on:click.prevent="setProfileView('followers')" v-if="followersCountVisible">
<h5>{{ $t('user_card.followers') }}</h5> <h5>{{ $t('user_card.followers') }}</h5>
<span>{{user.followers_count}}</span> <span>{{user.followers_count}}</span>
</div> </div>

View file

@ -58,6 +58,12 @@ const UserProfile = {
}, },
isExternal () { isExternal () {
return this.$route.name === 'external-user-profile' return this.$route.name === 'external-user-profile'
},
followeesTabVisible () {
return this.isUs || !this.user.hide_followings
},
followersTabVisible () {
return this.isUs || !this.user.hide_followers
} }
}, },
methods: { methods: {

View file

@ -15,13 +15,13 @@
:timeline-name="'user'" :timeline-name="'user'"
:user-id="fetchBy" :user-id="fetchBy"
/> />
<div :label="$t('user_card.followees')" v-if="!user.hide_followings"> <div :label="$t('user_card.followees')" v-if="followeesTabVisible">
<FollowList v-if="user.friends_count > 0" :userId="userId" :showFollowers="false" /> <FollowList v-if="user.friends_count > 0" :userId="userId" :showFollowers="false" />
<div class="userlist-placeholder" v-else> <div class="userlist-placeholder" v-else>
<i class="icon-spin3 animate-spin"></i> <i class="icon-spin3 animate-spin"></i>
</div> </div>
</div> </div>
<div :label="$t('user_card.followers')" v-if="!user.hide_followers"> <div :label="$t('user_card.followers')" v-if="followersTabVisible">
<FollowList v-if="user.followers_count > 0" :userId="userId" :showFollowers="true" /> <FollowList v-if="user.followers_count > 0" :userId="userId" :showFollowers="true" />
<div class="userlist-placeholder" v-else> <div class="userlist-placeholder" v-else>
<i class="icon-spin3 animate-spin"></i> <i class="icon-spin3 animate-spin"></i>