From f97d774c59711245e0efa47018afdcabe0620505 Mon Sep 17 00:00:00 2001 From: Inverle Date: Thu, 30 Oct 2025 08:18:02 +0100 Subject: Fix `console.log()` spam due to lack of `window.bcrypt` object (#8166) Harmless bug introduced in https://github.com/FreshRSS/FreshRSS/pull/7877 Before: image (load *Archiving* page for example, `init_crypto_forms()` is not called on view pages) --- p/scripts/extra.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/p/scripts/extra.js b/p/scripts/extra.js index 476970c3b..2e956d6db 100644 --- a/p/scripts/extra.js +++ b/p/scripts/extra.js @@ -17,6 +17,11 @@ function forgetOpenCategories() { } function init_crypto_forms() { + const crypto_forms = document.querySelectorAll('.crypto-form'); + if (crypto_forms.length === 0) { + return; + } + if (!(window.bcrypt)) { if (window.console) { console.log('FreshRSS waiting for bcrypt.js…'); @@ -26,7 +31,6 @@ function init_crypto_forms() { } /* globals bcrypt */ - const crypto_forms = document.querySelectorAll('.crypto-form'); crypto_forms.forEach(crypto_form => { const submit_button = crypto_form.querySelector('[type="submit"]'); if (submit_button) { -- cgit v1.2.3