nodebb-plugin-ezoic-infinite 1.4.79 → 1.4.80

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 +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.4.79",
3
+ "version": "1.4.80",
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
@@ -410,6 +410,13 @@
410
410
 
411
411
  clearTimeout(batchShowAdsTimer);
412
412
  batchShowAdsTimer = setTimeout(() => {
413
+ // CRITIQUE: Vérifier que nous sommes toujours sur la même page
414
+ const currentPageKey = getPageKey();
415
+ if (state.pageKey && currentPageKey !== state.pageKey) {
416
+ pendingShowAdsIds.clear();
417
+ return; // Page a changé, annuler
418
+ }
419
+
413
420
  if (pendingShowAdsIds.size === 0) return;
414
421
 
415
422
  const idsArray = Array.from(pendingShowAdsIds);
@@ -634,6 +641,10 @@
634
641
  }
635
642
  });
636
643
 
644
+ // CRITIQUE: Supprimer IDs de sessionDefinedIds IMMÉDIATEMENT
645
+ // Pour que le filtre validIds ne les trouve pas
646
+ allIds.forEach(id => sessionDefinedIds.delete(id));
647
+
637
648
  if (allIds.length > 0) {
638
649
  destroyPlaceholderIds(allIds); // Dire à Ezoic d'arrêter
639
650
  }