@wapitee/typhoonx-hydrogen 0.4.2 → 0.4.4
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/TyphoonX.js +2 -7
- package/package.json +1 -1
package/dist/TyphoonX.js
CHANGED
|
@@ -19,7 +19,6 @@ function TyphoonXClient({ cookieDomain, merchantId, shopId }) {
|
|
|
19
19
|
const currentUrlRef = useRef(null);
|
|
20
20
|
const previousUrlRef = useRef(null);
|
|
21
21
|
useEffect(() => {
|
|
22
|
-
let cancelled = false;
|
|
23
22
|
const clientId = getOrCreateClientId(cookieDomain);
|
|
24
23
|
const referrerFor = (url) => {
|
|
25
24
|
if (currentUrlRef.current !== url) {
|
|
@@ -29,9 +28,8 @@ function TyphoonXClient({ cookieDomain, merchantId, shopId }) {
|
|
|
29
28
|
return previousUrlRef.current ?? document.referrer;
|
|
30
29
|
};
|
|
31
30
|
const send = (payload) => {
|
|
32
|
-
if (
|
|
31
|
+
if (!canTrack())
|
|
33
32
|
return;
|
|
34
|
-
}
|
|
35
33
|
navigator.sendBeacon(COLLECT_ENDPOINT, new Blob([JSON.stringify(payload)], { type: 'application/json' }));
|
|
36
34
|
};
|
|
37
35
|
const shared = (url, currency) => ({
|
|
@@ -144,9 +142,6 @@ function TyphoonXClient({ cookieDomain, merchantId, shopId }) {
|
|
|
144
142
|
});
|
|
145
143
|
});
|
|
146
144
|
ready();
|
|
147
|
-
|
|
148
|
-
cancelled = true;
|
|
149
|
-
};
|
|
150
|
-
}, [canTrack, cookieDomain, merchantId, ready, shopId, subscribe]);
|
|
145
|
+
}, [canTrack, ready, subscribe]);
|
|
151
146
|
return null;
|
|
152
147
|
}
|