@gudhub/ssg-web-components-library 1.0.107 → 1.0.108
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
|
@@ -8,7 +8,8 @@ let recaptchaPromise = null;
|
|
|
8
8
|
|
|
9
9
|
function loadRecaptcha(siteKey) {
|
|
10
10
|
if (!siteKey) {
|
|
11
|
-
|
|
11
|
+
console.warn('reCAPTCHA site key is missing');
|
|
12
|
+
return Promise.resolve(null);
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
if (window.grecaptcha) return Promise.resolve(window.grecaptcha);
|
|
@@ -64,7 +65,9 @@ class GetInTouchForm extends GHComponent {
|
|
|
64
65
|
this.initConfig(this.config);
|
|
65
66
|
this.attachEventListeners();
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
if (this.recaptcha_site_key) {
|
|
69
|
+
loadRecaptcha(this.recaptcha_site_key).catch(console.error);
|
|
70
|
+
}
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -110,7 +113,8 @@ class GetInTouchForm extends GHComponent {
|
|
|
110
113
|
|
|
111
114
|
async getRecaptchaToken(action = 'submit') {
|
|
112
115
|
if (!this.recaptcha_site_key) {
|
|
113
|
-
|
|
116
|
+
console.warn('reCAPTCHA site key is missing');
|
|
117
|
+
return null;
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
const grecaptcha = await loadRecaptcha(this.recaptcha_site_key);
|