@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.
- package/dist/index.js +17 -16
- package/package.json +1 -1
- 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 (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
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
|
-
|
|
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 {
|