@hcaptcha/react-hcaptcha 1.3.0 → 1.3.1

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 (3) hide show
  1. package/dist/index.js +17 -16
  2. package/package.json +1 -1
  3. package/src/index.js +16 -15
package/dist/index.js CHANGED
@@ -104,22 +104,23 @@ var HCaptcha = /*#__PURE__*/function (_React$Component) {
104
104
 
105
105
  if (!isApiReady) {
106
106
  //Check if hCaptcha has already been loaded, if not create script tag and wait to render captcha
107
- if (!apiScriptRequested) {
108
- // Only create the script tag once, use a global variable to track
109
- mountCaptchaScript({
110
- apihost: apihost,
111
- assethost: assethost,
112
- endpoint: endpoint,
113
- hl: hl,
114
- host: host,
115
- imghost: imghost,
116
- recaptchacompat: reCaptchaCompat === false ? "off" : null,
117
- reportapi: reportapi,
118
- sentry: sentry,
119
- custom: custom
120
- });
121
- } // Add onload callback to global onload listeners
122
-
107
+ if (apiScriptRequested) {
108
+ return;
109
+ } // Only create the script tag once, use a global variable to track
110
+
111
+
112
+ mountCaptchaScript({
113
+ apihost: apihost,
114
+ assethost: assethost,
115
+ endpoint: endpoint,
116
+ hl: hl,
117
+ host: host,
118
+ imghost: imghost,
119
+ recaptchacompat: reCaptchaCompat === false ? "off" : null,
120
+ reportapi: reportapi,
121
+ sentry: sentry,
122
+ custom: custom
123
+ }); // Add onload callback to global onload listeners
123
124
 
124
125
  onLoadListeners.push(this.handleOnLoad);
125
126
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hcaptcha/react-hcaptcha",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "types": "types/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "files": [
package/src/index.js CHANGED
@@ -67,23 +67,24 @@ class HCaptcha extends React.Component {
67
67
  const { isApiReady } = this.state;
68
68
 
69
69
  if (!isApiReady) { //Check if hCaptcha has already been loaded, if not create script tag and wait to render captcha
70
-
71
- if (!apiScriptRequested) {
72
- // Only create the script tag once, use a global variable to track
73
- mountCaptchaScript({
74
- apihost,
75
- assethost,
76
- endpoint,
77
- hl,
78
- host,
79
- imghost,
80
- recaptchacompat: reCaptchaCompat === false? "off" : null,
81
- reportapi,
82
- sentry,
83
- custom
84
- });
70
+ if (apiScriptRequested) {
71
+ return;
85
72
  }
86
73
 
74
+ // Only create the script tag once, use a global variable to track
75
+ mountCaptchaScript({
76
+ apihost,
77
+ assethost,
78
+ endpoint,
79
+ hl,
80
+ host,
81
+ imghost,
82
+ recaptchacompat: reCaptchaCompat === false? "off" : null,
83
+ reportapi,
84
+ sentry,
85
+ custom
86
+ });
87
+
87
88
  // Add onload callback to global onload listeners
88
89
  onLoadListeners.push(this.handleOnLoad);
89
90
  } else {