@wapitee/typhoonx-hydrogen 0.4.5 → 0.4.6

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.
Files changed (2) hide show
  1. package/dist/TyphoonX.js +2 -7
  2. 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 (cancelled || !canTrack()) {
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
- return () => {
148
- cancelled = true;
149
- };
150
- }, [canTrack, cookieDomain, merchantId, ready, shopId, subscribe]);
145
+ }, [cookieDomain, merchantId, shopId, canTrack, ready, subscribe]);
151
146
  return null;
152
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wapitee/typhoonx-hydrogen",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "TyphoonX Hydrogen Analytics subscriber",
5
5
  "keywords": [
6
6
  "typhoonx",