IMPR: reset existing captcha on AJAX

This commit is contained in:
Tony Air 2024-03-29 18:39:30 +02:00
parent 7d086d9868
commit ed7c74d474

View File

@ -6,6 +6,10 @@ const CaptchaUI = ((window) => {
const init = () => {
console.log(`${NAME}: init`)
if (typeof window.grecaptcha.render !== 'function') {
window.grecaptcha.reset()
}
const submitListener = (e) => {
console.log(`${NAME}: Validating Captcha ...`)
const field = e.currentTarget.querySelectorAll(`.${NAME}, .g-recaptcha`).forEach((el) => {