abovefoldAlgorithm: wrap item selection

This commit is contained in:
Alex Gleason 2022-09-09 20:49:17 -05:00
parent 5749821b36
commit ec225ea1c5
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -32,7 +32,7 @@ const abovefoldAlgorithm: PickAlgorithm = (items, iteration, opts: Opts) => {
const insertIndex = Math.floor(rng() * opts.range[1] - opts.range[0]) + opts.range[0];
if (pageIndex === insertIndex) {
return items[page];
return items[page % items.length];
}
};