use prime number step for Who to follow panel

This commit is contained in:
Hakaba Hitoyo 2018-09-09 14:34:51 +09:00
parent 2eab0cb115
commit 3a17252929
1 changed files with 5 additions and 7 deletions

View File

@ -3,9 +3,10 @@ import apiService from '../../services/api/api.service.js'
function showWhoToFollow (panel, reply) {
var users = reply
var cn
var index = 0
var random = Math.floor(Math.random() * 10)
for (cn = random; cn < users.length; cn = cn + 10) {
var index
var step = 7
cn = Math.floor(Math.random() * step)
for (index = 0; index < 3; index++) {
var user
user = users[cn]
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) {