style(ui): request that all types defined

- check in more restrictive mode = request types
- define main types in static/js/core/types.js
This commit is contained in:
Edouard Vanbelle
2026-04-30 02:02:27 +02:00
parent 97ea87efc2
commit 3050556dc0
29 changed files with 560 additions and 345 deletions
+5 -5
View File
@@ -34,7 +34,7 @@ const notifications = (() => {
bellBtn.addEventListener('click', (e) => {
e.stopPropagation();
const open = wrapper.classList.toggle('open');
const open = wrapper?.classList.toggle('open');
bellBtn.classList.toggle('active', open);
// Close user-menu if it's open
@@ -46,7 +46,7 @@ const notifications = (() => {
// Close on outside click
document.addEventListener('click', (e) => {
if (!wrapper.contains(e.target)) {
if (!wrapper?.contains(/** @type {Node | null} */ (e.target))) {
close();
}
});
@@ -63,8 +63,8 @@ const notifications = (() => {
function close() {
const bellBtn = $('notif-bell-btn');
const wrapper = $('notif-wrapper');
wrapper.classList.remove('open');
bellBtn.classList.remove('active');
wrapper?.classList.remove('open');
bellBtn?.classList.remove('active');
}
/* ── badge helpers ──────────────────────────────────────── */
@@ -82,7 +82,7 @@ const notifications = (() => {
if (!badge) return;
if (_badgeCount > 0) {
badge.classList.remove('hidden');
badge.textContent = _badgeCount > 99 ? '99+' : _badgeCount;
badge.textContent = _badgeCount > 99 ? '99+' : String(_badgeCount);
} else {
badge.classList.add('hidden');
}