Suppress "similar topic" warning in Templates category

One of our staff just gave such a great answer that I want to reuse it. So I figured I’d create a template…

Maybe kill this warning when the Templates category is chosen?

3 Likes

I wrote a really stupid code, but it should work, hope I can help a little bit…

Stupid Code
let category_name = 'Templates'; // Or some else

let hide_box_css = document.createElement("style");
hide_box_css.innerHTML = ".similar-topics {display: none;}";
document.head.appendChild(hide_box_css);

setInterval(() => {
    try {
        const composer = document.getElementById("reply-control");
        if (composer &&
            composer.getElementsByClassName("category-input")[0].getElementsByClassName("select-kit-selected-name")[0].getElementsByClassName("category-name")[0].innerText !== category_name
        ) {
            hide_box_css.innerHTML = ".similar-topics {display: block;}";
        } else {
            hide_box_css.innerHTML = ".similar-topics {display: none;}";
        }
    } catch (err) {
        hide_box_css.innerHTML = ".similar-topics {display: block;}";
    }
}, 1000);

2 Likes