@gudhub/ssg-web-components-library 1.0.108 → 1.0.110
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
|
@@ -128,19 +128,22 @@ class GetInTouchForm extends GHComponent {
|
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
async handleSubmit(
|
|
132
|
-
|
|
133
|
-
const form = event.target;
|
|
131
|
+
async handleSubmit(e) {
|
|
132
|
+
e.preventDefault();
|
|
134
133
|
|
|
134
|
+
const form = e.target;
|
|
135
135
|
const validationResults = await this.inputsValidation(form);
|
|
136
136
|
|
|
137
137
|
if (validationResults.every(({ isValid }) => isValid)) {
|
|
138
138
|
this.addLoader();
|
|
139
139
|
|
|
140
140
|
try {
|
|
141
|
-
|
|
141
|
+
let token = null;
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
if (this.recaptcha_site_key) {
|
|
144
|
+
token = await this.getRecaptchaToken();
|
|
145
|
+
await this.verifyRecaptcha(token);
|
|
146
|
+
}
|
|
144
147
|
|
|
145
148
|
this.handleSuccessFormValidation(form, token);
|
|
146
149
|
|
|
@@ -150,7 +153,6 @@ class GetInTouchForm extends GHComponent {
|
|
|
150
153
|
}
|
|
151
154
|
|
|
152
155
|
this.removeLoader();
|
|
153
|
-
|
|
154
156
|
} else {
|
|
155
157
|
validationResults
|
|
156
158
|
.filter(item => typeof item === 'object')
|