forked from leftypol/leftypol
main.js: HOTFIX double captcha init
This commit is contained in:
parent
eb6649b260
commit
25089f5cbb
1 changed files with 20 additions and 18 deletions
|
@ -262,26 +262,28 @@ window.onCaptchaLoadTurnstile_post_thread = function() {
|
||||||
|
|
||||||
// Should be called by the captcha API when it's ready. Ugly I know... D:
|
// Should be called by the captcha API when it's ready. Ugly I know... D:
|
||||||
function onCaptchaLoadTurnstile(action) {
|
function onCaptchaLoadTurnstile(action) {
|
||||||
let renderer = {
|
if (captcha_renderer === null) {
|
||||||
renderOn: function(container) {
|
let renderer = {
|
||||||
let widgetId = turnstile.render(container, {
|
renderOn: function(container) {
|
||||||
sitekey: "{{ config.turnstile_public }}",
|
let widgetId = turnstile.render(container, {
|
||||||
action: action,
|
sitekey: "{{ config.turnstile_public }}",
|
||||||
});
|
action: action,
|
||||||
if (widgetId === undefined) {
|
});
|
||||||
return null;
|
if (widgetId === undefined) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return widgetId;
|
||||||
|
},
|
||||||
|
remove: function(widgetId) {
|
||||||
|
turnstile.remove(widgetId);
|
||||||
|
},
|
||||||
|
reset: function(widgetId) {
|
||||||
|
turnstile.reset(widgetId);
|
||||||
}
|
}
|
||||||
return widgetId;
|
};
|
||||||
},
|
|
||||||
remove: function(widgetId) {
|
|
||||||
turnstile.remove(widgetId);
|
|
||||||
},
|
|
||||||
reset: function(widgetId) {
|
|
||||||
turnstile.reset(widgetId);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onCaptchaLoad(renderer);
|
onCaptchaLoad(renderer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initCaptchaImpl() {
|
function initCaptchaImpl() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue