Merge branch 'prime-number-step-for-who-to-follow-panel' into 'develop'

Prime number step for Who to follow panel

See merge request pleroma/pleroma-fe!340
This commit is contained in:
kaniini 2018-09-09 11:55:25 +00:00
commit 3f72b611c1

View file

@ -3,9 +3,10 @@ import apiService from '../../services/api/api.service.js'
function showWhoToFollow (panel, reply) { function showWhoToFollow (panel, reply) {
var users = reply var users = reply
var cn var cn
var index = 0 var index
var random = Math.floor(Math.random() * 10) var step = 7
for (cn = random; cn < users.length; cn = cn + 10) { cn = Math.floor(Math.random() * step)
for (index = 0; index < 3; index++) {
var user var user
user = users[cn] user = users[cn]
var img var img
@ -46,11 +47,8 @@ function showWhoToFollow (panel, reply) {
} }
}) })
} }
index = index + 1
if (index > 2) {
break
}
} }
cn = (cn + step) % users.length
} }
function getWhoToFollow (panel) { function getWhoToFollow (panel) {