@salesforcedevs/dw-components 1.3.148-canary.28 → 1.3.148-canary.30
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
|
@@ -21,7 +21,14 @@
|
|
|
21
21
|
step-index={index}
|
|
22
22
|
step-total-count={stepsData.length}
|
|
23
23
|
user-info={formIncomingUserInfo}
|
|
24
|
-
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
if:true={stepDatum.formData}
|
|
27
|
+
slot="card-step-captcha-slot"
|
|
28
|
+
>
|
|
29
|
+
<slot name="captcha-slot"></slot>
|
|
30
|
+
</div>
|
|
31
|
+
</dw-j2s-card-sequence-step>
|
|
25
32
|
</dx-step-sequence-step>
|
|
26
33
|
</template>
|
|
27
34
|
</dx-step-sequence>
|
|
@@ -226,11 +226,10 @@ export default class J2sCardSequence extends LightningElement {
|
|
|
226
226
|
// If the recaptcha element expires on its own while you are not on the 2nd (form) step, it messes with the
|
|
227
227
|
// page's layout (basically breaks it). So, we need to reset it _before_ expiration if you leave that step.
|
|
228
228
|
// We do it with a timeout so that the token is not immediately wiped if the user goes back and forth a bit.
|
|
229
|
-
this._recaptchaResetTimeoutId = window.setTimeout(
|
|
230
|
-
this.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}, 1000 * 30 /* 30 seconds */);
|
|
229
|
+
this._recaptchaResetTimeoutId = window.setTimeout(
|
|
230
|
+
() => this.resetRecaptcha(),
|
|
231
|
+
1000 * 30 /* 30 seconds */
|
|
232
|
+
);
|
|
234
233
|
}
|
|
235
234
|
}
|
|
236
235
|
|
|
@@ -274,6 +273,7 @@ export default class J2sCardSequence extends LightningElement {
|
|
|
274
273
|
if (resOutput?.status === "success") {
|
|
275
274
|
this.jumpToStepIndex(2, false);
|
|
276
275
|
this.initialStepIndex = 0; // don't save final step in storage; rather, reset the starting step
|
|
276
|
+
this.resetRecaptcha();
|
|
277
277
|
} else {
|
|
278
278
|
throw new Error(
|
|
279
279
|
`Form submission failed. (status: ${resOutput.status}, message: ${resOutput.errorMessage})`
|
|
@@ -318,6 +318,13 @@ export default class J2sCardSequence extends LightningElement {
|
|
|
318
318
|
);
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
+
private resetRecaptcha() {
|
|
322
|
+
clearTimeout(this._recaptchaResetTimeoutId as number);
|
|
323
|
+
this._recaptchaResetTimeoutId = null;
|
|
324
|
+
this.recaptchaToken = "";
|
|
325
|
+
(window as any).grecaptcha.reset();
|
|
326
|
+
}
|
|
327
|
+
|
|
321
328
|
private jumpToStepIndex(stepIndex: number, andStoreIndex = true) {
|
|
322
329
|
if (andStoreIndex) {
|
|
323
330
|
this.initialStepIndex = stepIndex; // update sessionStorage value
|