diff options
| author | Hakaba Hitoyo <example@example.com> | 2018-09-09 14:34:51 +0900 |
|---|---|---|
| committer | Hakaba Hitoyo <example@example.com> | 2018-09-09 14:34:51 +0900 |
| commit | 3a172529293e9669767d39d175e8748ace49bdd0 (patch) | |
| tree | 61f4c59314b60776d5912733cd8d40ed33a7cda4 /src/components/who_to_follow_panel | |
| parent | 2eab0cb1150dd6dc2c5c34bc350ac07869d6edd4 (diff) | |
use prime number step for Who to follow panel
Diffstat (limited to 'src/components/who_to_follow_panel')
| -rw-r--r-- | src/components/who_to_follow_panel/who_to_follow_panel.js | 12 |
1 files changed, 5 insertions, 7 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 6766e561..ce60308f 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 @@ -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) { |
