nodebb-plugin-ezoic-infinite 1.4.22 → 1.4.23

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/client.js +10 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.4.22",
3
+ "version": "1.4.23",
4
4
  "description": "Production-ready Ezoic infinite ads integration for NodeBB 4.x",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/public/client.js CHANGED
@@ -448,7 +448,12 @@
448
448
  const r = safeRect(wrap);
449
449
  if (r && (r.top > window.innerHeight + 1200 || r.bottom < -1200)) continue;
450
450
 
451
- state.retryById.set(id, tries + 1);
451
+ // Incrémenter le compteur seulement si Ezoic est chargé
452
+ // Sinon on est juste en attente de chargement, pas un vrai échec
453
+ const ezoicReady = window.ezstandalone && typeof window.ezstandalone.showAds === 'function';
454
+ if (ezoicReady) {
455
+ state.retryById.set(id, tries + 1);
456
+ }
452
457
  enqueueRetry(id);
453
458
  scheduledAny = true;
454
459
  }
@@ -518,7 +523,7 @@
518
523
  return;
519
524
  }
520
525
 
521
- if (attempts < 50) setTimeout(waitForPh, 50);
526
+ if (attempts < 100) setTimeout(waitForPh, 50);
522
527
  })();
523
528
  }
524
529
 
@@ -851,6 +856,7 @@
851
856
  bindScroll();
852
857
  ensureObserver();
853
858
  state.pageKey = getPageKey();
854
- scheduleRun();
855
- setTimeout(scheduleRun, 300);
859
+ // Attendre un peu plus longtemps au démarrage initial pour Ezoic
860
+ setTimeout(scheduleRun, 800);
861
+ setTimeout(scheduleRun, 1500);
856
862
  })();