[fix] settings: javascript crash when entering due to missing search form

This commit is contained in:
Bnyro 2024-12-15 12:44:25 +01:00 committed by Markus Heiser
parent 8d2c01e4ce
commit c8e932647b

View file

@ -186,6 +186,7 @@
// override form submit action to update the actually selected categories // override form submit action to update the actually selected categories
const form = d.querySelector("#search"); const form = d.querySelector("#search");
if (form != null) {
searxng.on(form, 'submit', (event) => { searxng.on(form, 'submit', (event) => {
event.preventDefault(); event.preventDefault();
const categoryValuesInput = d.querySelector("#selected-categories"); const categoryValuesInput = d.querySelector("#selected-categories");
@ -200,6 +201,7 @@
} }
form.submit(); form.submit();
}); });
}
}); });
})(window, document, window.searxng); })(window, document, window.searxng);