@gudhub/ssg-web-components-library 1.0.74 → 1.0.76

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/ssg-web-components-library",
3
- "version": "1.0.74",
3
+ "version": "1.0.76",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -15,17 +15,21 @@ class CookiesPopup extends GHComponent {
15
15
 
16
16
  try {
17
17
  if (inEU == null) {
18
- await fetch("https://ipapi.co/json/").then((response) => response.json()).then((data) => {
19
- if (data.country === "UA") {
20
- inEU = true;
21
- } else {
22
- inEU = data.in_eu
23
- }
24
- });
25
- localStorage.setItem("inEU", inEU)
18
+ await fetch("https://ipapi.co/json/")
19
+ .then((response) => response.json())
20
+ .then((data) => {
21
+ if (data.country === "UA") {
22
+ inEU = true;
23
+ } else {
24
+ inEU = data.in_eu;
25
+ }
26
+ localStorage.setItem("inEU", inEU.toString());
27
+ });
28
+ } else {
29
+ inEU = (inEU === "true");
26
30
  }
27
31
  } catch (error) {
28
- inEU = true; // This was done because the API had a limited number of requests.
32
+ inEU = true;
29
33
  }
30
34
 
31
35
  if (inEU) {
@@ -52,6 +56,8 @@ class CookiesPopup extends GHComponent {
52
56
 
53
57
  document.querySelector('head').prepend(script);
54
58
  }
59
+
60
+ if(localStorage.getItem("agreeWithCookies") === "true") this.gotIt();
55
61
  }
56
62
  }
57
63