aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-09-10 07:54:56 +0200
committerGravatar GitHub <noreply@github.com> 2022-09-10 07:54:56 +0200
commitf1854cd0ae4bb41a7671a0efe9e3e483ead2a1c1 (patch)
treea6c0702916d7a252883a42156c36bed463b7797e
parent0c472402f22816daa66982a815febc464c4856c8 (diff)
Fix auto-loading of more articles (#4593)
Fix regression from https://github.com/FreshRSS/FreshRSS/pull/4532 https://github.com/FreshRSS/FreshRSS/issues/3974
-rw-r--r--p/scripts/main.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 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 article
load_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();
+ }
}
}
}