From ec225ea1c5b4de5737970f42d46d62b580260922 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 9 Sep 2022 20:49:17 -0500 Subject: [PATCH] abovefoldAlgorithm: wrap item selection --- app/soapbox/features/timeline-insertion/abovefold.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/features/timeline-insertion/abovefold.ts b/app/soapbox/features/timeline-insertion/abovefold.ts index dc6e553d1..71ab51f81 100644 --- a/app/soapbox/features/timeline-insertion/abovefold.ts +++ b/app/soapbox/features/timeline-insertion/abovefold.ts @@ -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]; } };