@kontextso/sdk-react-native 0.0.10-rc.7 → 0.0.10-rc.9

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/index.js CHANGED
@@ -2849,13 +2849,17 @@ function useAdViewed(ad, ref) {
2849
2849
  }
2850
2850
  };
2851
2851
  (0, import_react6.useEffect)(() => {
2852
- if (!ref?.current || !ad || !context?.visitorId || !context?.userId || ad.isError || ad.isLoading || ad.isStreaming || ad.viewed) {
2852
+ if (!ad || !context?.visitorId || !context?.userId || ad.isError || ad.isLoading || ad.isStreaming || ad.viewed) {
2853
2853
  return;
2854
2854
  }
2855
2855
  if (typeof window.IntersectionObserver === "undefined") {
2856
2856
  sendRequest();
2857
2857
  return;
2858
2858
  }
2859
+ if (!ref?.current) {
2860
+ sendRequest();
2861
+ return;
2862
+ }
2859
2863
  const observer = new window.IntersectionObserver((entries, observer2) => {
2860
2864
  entries.forEach((entry) => {
2861
2865
  if (entry.isIntersecting) {
@@ -3105,11 +3109,7 @@ var InlineAd = ({ code, messageId, wrapper }) => {
3105
3109
  setLinkIncluded(true);
3106
3110
  }
3107
3111
  }, [ad]);
3108
- if (!context) {
3109
- log.error("AdsContext is null");
3110
- return null;
3111
- }
3112
- if (!ad || !ad.content || context?.isDisabled) return null;
3112
+ if (!context || !ad || !ad.content || context?.isDisabled) return null;
3113
3113
  if (ad.isLoading || ad.content?.trim().toLowerCase().includes("none"))
3114
3114
  return null;
3115
3115
  const onProgress = (progress) => {
package/dist/index.mjs CHANGED
@@ -2817,13 +2817,17 @@ function useAdViewed(ad, ref) {
2817
2817
  }
2818
2818
  };
2819
2819
  useEffect5(() => {
2820
- if (!ref?.current || !ad || !context?.visitorId || !context?.userId || ad.isError || ad.isLoading || ad.isStreaming || ad.viewed) {
2820
+ if (!ad || !context?.visitorId || !context?.userId || ad.isError || ad.isLoading || ad.isStreaming || ad.viewed) {
2821
2821
  return;
2822
2822
  }
2823
2823
  if (typeof window.IntersectionObserver === "undefined") {
2824
2824
  sendRequest();
2825
2825
  return;
2826
2826
  }
2827
+ if (!ref?.current) {
2828
+ sendRequest();
2829
+ return;
2830
+ }
2827
2831
  const observer = new window.IntersectionObserver((entries, observer2) => {
2828
2832
  entries.forEach((entry) => {
2829
2833
  if (entry.isIntersecting) {
@@ -3073,11 +3077,7 @@ var InlineAd = ({ code, messageId, wrapper }) => {
3073
3077
  setLinkIncluded(true);
3074
3078
  }
3075
3079
  }, [ad]);
3076
- if (!context) {
3077
- log.error("AdsContext is null");
3078
- return null;
3079
- }
3080
- if (!ad || !ad.content || context?.isDisabled) return null;
3080
+ if (!context || !ad || !ad.content || context?.isDisabled) return null;
3081
3081
  if (ad.isLoading || ad.content?.trim().toLowerCase().includes("none"))
3082
3082
  return null;
3083
3083
  const onProgress = (progress) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontextso/sdk-react-native",
3
- "version": "0.0.10-rc.7",
3
+ "version": "0.0.10-rc.9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",