A free, self-hostable news aggregator…
Fix auto-loading of more articles (#4593)
Alexandre Alapetitef1854cd0ae4b
diff --git a/p/scripts/main.js b/p/scripts/main.jsindex 90e7d79c8..a9f0986de 100644--- a/p/scripts/main.js+++ b/p/scripts/main.js@@ -726,9 +726,12 @@ function onScroll() {box_to_follow.scrollTop + box_to_follow.offsetHeight + (window.innerHeight / 2) >= streamFooter.offsetTop) {// Too close to the last pre-loaded articleload_more_posts();- } else if (document.querySelectorAll('.flux.current ~ .flux').length <= 5) {- // Too few pre-loaded articles- load_more_posts();+ } else {+ const after = document.querySelectorAll('.flux.current ~ .flux').length;+ if (after > 0 && after <= 5) {+ // Too few pre-loaded articles+ load_more_posts();+ }}}}