Files
librechat-custom/assets/custom2.js
T

29 lines
808 B
JavaScript

// Co-op login-page polish.
// The auth form is client-rendered (React), so a plain `load` listener runs
// too early — a MutationObserver re-checks on every DOM change instead.
(function () {
function hideSignupPrompt() {
document.querySelectorAll('p').forEach(function (p) {
var link = p.querySelector('a[href*="register"]');
var text = (p.textContent || '');
if (link || text.indexOf("Don't have an account") !== -1) {
p.style.display = 'none';
}
});
}
function start() {
hideSignupPrompt();
new MutationObserver(hideSignupPrompt).observe(document.body, {
childList: true,
subtree: true,
});
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', start);
} else {
start();
}
})();