@kontextso/sdk-react-native 0.0.10-rc.7 → 0.0.10-rc.8
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 +5 -1
- package/dist/index.mjs +5 -1
- package/package.json +1 -1
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 (!
|
|
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) {
|
package/dist/index.mjs
CHANGED
|
@@ -2817,13 +2817,17 @@ function useAdViewed(ad, ref) {
|
|
|
2817
2817
|
}
|
|
2818
2818
|
};
|
|
2819
2819
|
useEffect5(() => {
|
|
2820
|
-
if (!
|
|
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) {
|