@folklore/ads 0.0.68 → 0.0.70

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 CHANGED
@@ -1076,13 +1076,9 @@ function useRichAd(containerRef, id) {
1076
1076
  } catch (e) {}
1077
1077
  if (newRichAd !== null) {
1078
1078
  const container = containerRef.current || document;
1079
- const iframes = container.querySelector('iframe');
1080
- for (let i = 0; i < iframes.length; i += 1) {
1081
- const iframe = iframes[i];
1082
- if (iframe.contentWindow === event.source) {
1083
- setRichAd(newRichAd);
1084
- break;
1085
- }
1079
+ const iframe = container.querySelector('iframe') || null;
1080
+ if (iframe !== null && iframe.contentWindow === event.source) {
1081
+ setRichAd(newRichAd);
1086
1082
  }
1087
1083
  }
1088
1084
  }
package/dist/es.js CHANGED
@@ -1058,13 +1058,9 @@ function useRichAd(containerRef, id) {
1058
1058
  } catch (e) {}
1059
1059
  if (newRichAd !== null) {
1060
1060
  const container = containerRef.current || document;
1061
- const iframes = container.querySelector('iframe');
1062
- for (let i = 0; i < iframes.length; i += 1) {
1063
- const iframe = iframes[i];
1064
- if (iframe.contentWindow === event.source) {
1065
- setRichAd(newRichAd);
1066
- break;
1067
- }
1061
+ const iframe = container.querySelector('iframe') || null;
1062
+ if (iframe !== null && iframe.contentWindow === event.source) {
1063
+ setRichAd(newRichAd);
1068
1064
  }
1069
1065
  }
1070
1066
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@folklore/ads",
3
- "version": "0.0.68",
3
+ "version": "0.0.70",
4
4
  "description": "Ads library",
5
5
  "keywords": [
6
6
  "javascript",
@@ -50,9 +50,9 @@
50
50
  "publishConfig": {
51
51
  "access": "public"
52
52
  },
53
- "gitHead": "54decbea354a5a8fa99c25f34918460bb9666bb2",
53
+ "gitHead": "bdf0a3c61c45af310bb65ae01d2b46bf8d16a8ba",
54
54
  "dependencies": {
55
- "@folklore/hooks": "^0.0.62",
55
+ "@folklore/hooks": "^0.0.63",
56
56
  "@folklore/tracking": "^0.0.23",
57
57
  "@folklore/utils": "^0.1.1",
58
58
  "classnames": "^2.5.1",