@folklore/ads 0.0.87 → 0.0.89
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/dist/cjs.js +7 -2
- package/dist/es.js +7 -2
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -954,12 +954,17 @@ function useAd(path, size) {
|
|
|
954
954
|
// Render ad when visible
|
|
955
955
|
React.useEffect(() => {
|
|
956
956
|
const slotReady = slot !== null && !slot.isDefined();
|
|
957
|
-
if (adsReady && slotReady
|
|
957
|
+
if (adsReady && slotReady) {
|
|
958
958
|
adsManager.defineSlot(slot);
|
|
959
|
+
}
|
|
960
|
+
}, [adsManager, adsReady, slot]);
|
|
961
|
+
React.useEffect(() => {
|
|
962
|
+
const slotReady = slot !== null && !slot.isDisplayed();
|
|
963
|
+
if (adsReady && slotReady && (alwaysRender || isVisible)) {
|
|
959
964
|
adsManager.displaySlot(slot);
|
|
960
965
|
track('Init', slot);
|
|
961
966
|
}
|
|
962
|
-
}, [adsManager, adsReady, slot, alwaysRender,
|
|
967
|
+
}, [adsManager, adsReady, slot, alwaysRender, isVisible, track]);
|
|
963
968
|
|
|
964
969
|
// Refresh ads slot
|
|
965
970
|
React.useEffect(() => {
|
package/dist/es.js
CHANGED
|
@@ -952,12 +952,17 @@ function useAd(path, size) {
|
|
|
952
952
|
// Render ad when visible
|
|
953
953
|
useEffect(() => {
|
|
954
954
|
const slotReady = slot !== null && !slot.isDefined();
|
|
955
|
-
if (adsReady && slotReady
|
|
955
|
+
if (adsReady && slotReady) {
|
|
956
956
|
adsManager.defineSlot(slot);
|
|
957
|
+
}
|
|
958
|
+
}, [adsManager, adsReady, slot]);
|
|
959
|
+
useEffect(() => {
|
|
960
|
+
const slotReady = slot !== null && !slot.isDisplayed();
|
|
961
|
+
if (adsReady && slotReady && (alwaysRender || isVisible)) {
|
|
957
962
|
adsManager.displaySlot(slot);
|
|
958
963
|
track('Init', slot);
|
|
959
964
|
}
|
|
960
|
-
}, [adsManager, adsReady, slot, alwaysRender,
|
|
965
|
+
}, [adsManager, adsReady, slot, alwaysRender, isVisible, track]);
|
|
961
966
|
|
|
962
967
|
// Refresh ads slot
|
|
963
968
|
useEffect(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@folklore/ads",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.89",
|
|
4
4
|
"description": "Ads library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "34143443e4db4cac8aba704b788eafe3929e1481",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@folklore/hooks": "^0.0.71",
|
|
56
56
|
"@folklore/tracking": "^0.0.26",
|