main.js: unfuck dynamic captcha support

This commit is contained in:
Zankaria 2024-07-29 21:24:14 +02:00
parent 8f98665a1c
commit 6097849ea2

View file

@ -241,7 +241,7 @@ function get_cookie(cookie_name) {
{% endraw %}
{% if config.dynamic_captcha %}
function is_dynamic_captcha_enabled() {
let cookie = get_cookie('require-captcha');
let cookie = get_cookie('captcha-required');
return cookie === '1';
}
@ -254,7 +254,7 @@ function get_captcha_pub_key() {
}
function init_dynamic_captcha() {
if (!is_dynamic_captcha_enabled()) {
if (is_dynamic_captcha_enabled()) {
let pub_key = get_captcha_pub_key();
if (!pub_key) {
console.error("Missing public captcha key!");
@ -265,6 +265,8 @@ function init_dynamic_captcha() {
captcha_hook.style = "";
}
}
{% else %}
function init_dynamic_captcha() {}
{% endif %}
{% raw %}
@ -420,6 +422,7 @@ var script_settings = function(script_name) {
function init() {
init_stylechooser();
init_dynamic_captcha();
{% endraw %}
{% if config.allow_delete %}