From 58cefc2853013c83d299459481c6b198ff1f7281 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 16 Jan 2023 20:50:03 +0800 Subject: [PATCH] Also activate boosts carousel for serial boosts --- src/pages/home.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/home.jsx b/src/pages/home.jsx index ff264e26..e03f04d1 100644 --- a/src/pages/home.jsx +++ b/src/pages/home.jsx @@ -52,16 +52,22 @@ function Home({ hidden }) { if (snapStates.settings.boostsCarousel) { let specialHome = []; let boostStash = []; + let serialBoosts = 0; for (let i = 0; i < homeValues.length; i++) { const status = homeValues[i]; if (status.reblog) { boostStash.push(status); + serialBoosts++; } else { specialHome.push(status); + if (serialBoosts < 3) { + serialBoosts = 0; + } } } // if boostStash is more than quarter of homeValues - if (boostStash.length > homeValues.length / 4) { + // or if there are 3 or more boosts in a row + if (boostStash.length > homeValues.length / 4 || serialBoosts >= 3) { // if boostStash is more than 3 quarter of homeValues const boostStashID = boostStash.map((status) => status.id); if (boostStash.length > (homeValues.length * 3) / 4) {