diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index 170bc03b..a7c8b306 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -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;