move nav badge handling to favicon and sum total there for it

This commit is contained in:
Gigiaj 2025-06-19 14:23:19 -05:00
parent 8cbc9ce601
commit 60af716dbc

View file

@ -57,7 +57,11 @@ function FaviconUpdater() {
useEffect(() => {
let notification = false;
let highlight = false;
let total = 0;
roomToUnread.forEach((unread) => {
if (unread.from === null) {
total += unread.total;
}
if (unread.total > 0) {
notification = true;
}
@ -71,6 +75,11 @@ function FaviconUpdater() {
} else {
setFavicon(LogoSVG);
}
try {
navigator.setAppBadge(total);
} catch (e) {
// Likely Firefox/Gecko-based and doesn't support badging API
}
}, [roomToUnread]);
return null;