From 4199bd5ccff5ef20a38d8863823a3e22f0759caf Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 30 Sep 2026 14:26:01 +0200 Subject: [PATCH] fix: hand floating chat reminders over to the BGS rail --- viewer/activity.js | 4 ++-- viewer/ui.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/viewer/activity.js b/viewer/activity.js index dcb6e6b..0aad2fd 100644 --- a/viewer/activity.js +++ b/viewer/activity.js @@ -394,11 +394,11 @@ export function mountActivity( refreshAvatars() { view?.refresh(); }, - setUnread(n) { + setUnread(n, notifications = true) { const badge = root.querySelector(".unread"); badge.textContent = n; badge.hidden = !n; - shortcut.hidden = !n || analysis; + shortcut.hidden = !notifications || !n || analysis; shortcut.innerHTML = `${icon("chat")} ${n}`; shortcut.setAttribute("aria-label", `${t("chat")}: ${n}`); }, diff --git a/viewer/ui.js b/viewer/ui.js index d8f3c12..e880bff 100644 --- a/viewer/ui.js +++ b/viewer/ui.js @@ -431,6 +431,7 @@ export function mountGame(target, options = {}) { activity.update(s, analysis, colorBlind); updateUnread(); } + let chatNotifications = true; function updateUnread() { const n = options.chat?.snapshot.unreadIds.length ?? 0; const badge = play.querySelector(".unread-badge"); @@ -438,7 +439,7 @@ export function mountGame(target, options = {}) { badge.textContent = n; badge.hidden = !n; } - activity.setUnread(n); + activity.setUnread(n, chatNotifications); } const offChat = options.chat?.subscribe(updateUnread); function showDialog(html) { @@ -817,6 +818,7 @@ export function mountGame(target, options = {}) { render(); }, setPreferences(p) { + chatNotifications = p.chatNotifications !== false; analysis = p.analysis === true; colorBlind = p.colorBlind === true; sound = p.sound === true;