Browse Source
now also considers unreads from channels. unminified code: function checkUnread() { const selectBadges = "#sidebarChannelContainer .unread-title.has-badge > span.badge"; const pmUnread = Array.from(document.querySelectorAll(selectBadges)) .reduce((total, el) => total += parseInt(el.innerText), 0); const channelsUnread = document.querySelectorAll("#sidebarChannelContainer .unread-title:not(.has-badge)").length; const teamsUnread = document.querySelectorAll(".team-sidebar .team-container.unread").length; updateBadge(pmUnread + channelsUnread + teamsUnread); } function updateBadge(count) { if (count && count >= 1) rambox.setUnreadCount(count); else rambox.clearUnreadCount(); } setInterval(checkUnread, 3e3);pull/1988/head
1 changed files with 1 additions and 1 deletions
Loading…
Reference in new issue