forked from leftypol/leftypol
main.js: load captcha from callback only on pages with post forms
This commit is contained in:
parent
9b6563b816
commit
76d237bc89
1 changed files with 2 additions and 2 deletions
|
@ -271,7 +271,7 @@ var captcha_renderer = null;
|
|||
|
||||
{% if config.hcaptcha %} // If hcaptcha
|
||||
function onCaptchaLoadHcaptcha() {
|
||||
if (captcha_renderer === null) {
|
||||
if (captcha_renderer === null && (active_page === 'index' || active_page === 'catalog' || active_page === 'thread')) {
|
||||
let renderer = {
|
||||
renderOn: (container) => hcaptcha.render(container, {
|
||||
sitekey: "{{ config.hcaptcha_public }}",
|
||||
|
@ -310,7 +310,7 @@ window.onCaptchaLoadTurnstile_post_thread = function() {
|
|||
|
||||
// Should be called by the captcha API when it's ready. Ugly I know... D:
|
||||
function onCaptchaLoadTurnstile(action) {
|
||||
if (captcha_renderer === null) {
|
||||
if (captcha_renderer === null && (active_page === 'index' || active_page === 'catalog' || active_page === 'thread')) {
|
||||
let renderer = {
|
||||
renderOn: function(container) {
|
||||
let widgetId = turnstile.render('#' + container, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue