nodebb-plugin-ezoic-infinite 1.4.18 → 1.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/client.js +10 -2
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -402,6 +402,14 @@
|
|
|
402
402
|
|
|
403
403
|
|
|
404
404
|
function refillUnfilled() {
|
|
405
|
+
// Si tous les IDs disponibles sont blacklistés, ne pas réessayer
|
|
406
|
+
const totalPoolSize = state.poolTopics.length + state.poolPosts.length + state.poolCategories.length +
|
|
407
|
+
state.usedTopics.size + state.usedPosts.size + state.usedCategories.size;
|
|
408
|
+
if (totalPoolSize > 0 && state.badIds.size >= totalPoolSize) {
|
|
409
|
+
// Tous les IDs disponibles sont blacklistés - arrêter les retry
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
|
|
405
413
|
const wraps = Array.from(document.querySelectorAll(`.${WRAP_CLASS}`));
|
|
406
414
|
let scheduledAny = false;
|
|
407
415
|
|
|
@@ -422,7 +430,7 @@
|
|
|
422
430
|
}
|
|
423
431
|
|
|
424
432
|
const tries = (state.retryById.get(id) || 0);
|
|
425
|
-
if (tries >=
|
|
433
|
+
if (tries >= 3) { state.badIds && state.badIds.add(id); continue; }
|
|
426
434
|
|
|
427
435
|
const r = safeRect(wrap);
|
|
428
436
|
if (r && (r.top > window.innerHeight + 1200 || r.bottom < -1200)) continue;
|
|
@@ -799,7 +807,7 @@
|
|
|
799
807
|
// Réinitialiser le compteur d'attente de recyclage à chaque reprise de scroll
|
|
800
808
|
state.poolWaitAttempts = 0;
|
|
801
809
|
enforceNoAdjacentAds();
|
|
802
|
-
scheduleRefill(
|
|
810
|
+
scheduleRefill(2000);
|
|
803
811
|
// Tenter aussi d'insérer de nouvelles pubs si de nouveaux items sont apparus
|
|
804
812
|
scheduleRun();
|
|
805
813
|
});
|