diff options
| author | HJ <spam@hjkos.com> | 2019-01-04 08:43:00 +0000 |
|---|---|---|
| committer | HJ <spam@hjkos.com> | 2019-01-04 08:43:00 +0000 |
| commit | 2184334ad919fdcf167ac2f1657d508481ec431b (patch) | |
| tree | 1ec5f09e7e9fc4aa6032bf864d6f13abcd81e765 /src | |
| parent | 35d75be1d68ca5cd4aef710e306164f8cc0b56cc (diff) | |
| parent | 702f013225946a8b9adf329cc2d2df20314c5360 (diff) | |
Merge branch 'avoid-duplicates-in-who-to-follow-panel' into 'develop'
[Debug] Avoid duplicates in the who to follow panel
See merge request pleroma/pleroma-fe!441
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/who_to_follow_panel/who_to_follow_panel.js | 6 | ||||
| -rw-r--r-- | src/components/who_to_follow_panel/who_to_follow_panel.vue | 20 |
2 files changed, 14 insertions, 12 deletions
diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js index eaeb527a..fddc7c7d 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.js +++ b/src/components/who_to_follow_panel/who_to_follow_panel.js @@ -1,10 +1,12 @@ import apiService from '../../services/api/api.service.js' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' +import _ from 'lodash' function showWhoToFollow (panel, reply) { + _.shuffle(reply) + panel.usersToFollow.forEach((toFollow, index) => { - let randIndex = Math.floor(Math.random() * reply.length) - let user = reply[randIndex] + let user = reply[index] let img = user.avatar || '/images/avi.png' let name = user.acct diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue index ad6a028e..272c41d3 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.vue +++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue @@ -7,15 +7,13 @@ </div> </div> <div class="panel-body who-to-follow"> - <p> - <span v-for="user in usersToFollow"> - <img v-bind:src="user.img" /> - <router-link v-bind:to="userProfileLink(user.id, user.name)"> - {{user.name}} - </router-link><br /> - </span> - <img v-bind:src="$store.state.instance.logo"> <a v-bind:href="moreUrl" target="_blank">{{$t('who_to_follow.more')}}</a> - </p> + <span v-for="user in usersToFollow"> + <img v-bind:src="user.img" /> + <router-link v-bind:to="userProfileLink(user.id, user.name)"> + {{user.name}} + </router-link><br /> + </span> + <img v-bind:src="$store.state.instance.logo"> <a v-bind:href="moreUrl" target="_blank">{{$t('who_to_follow.more')}}</a> </div> </div> </div> @@ -31,7 +29,9 @@ width: 32px; height: 32px; } - .who-to-follow p { + .who-to-follow { + padding: 0.5em 1em 0.5em 1em; + margin: 0px; line-height: 40px; white-space: nowrap; overflow: hidden; |
