From bdbc4330f8c180f013522dc76525e871c86e408a Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Mon, 25 Oct 2021 10:21:11 +0200 Subject: fix: no gitter badge for mentions in channels (#752) --- recipes/gitter/webview.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'recipes/gitter/webview.js') diff --git a/recipes/gitter/webview.js b/recipes/gitter/webview.js index 0026790..c4eee5b 100644 --- a/recipes/gitter/webview.js +++ b/recipes/gitter/webview.js @@ -7,13 +7,16 @@ function _interopRequireDefault(obj) { module.exports = Ferdi => { const getMessages = () => { // get unread messages - let count = 0; + let directCount = 0; for (const node of document.querySelectorAll('div.unread-indicator')) { - count += Ferdi.safeParseInt(node.textContent); + directCount += Ferdi.safeParseInt(node.textContent); } + const channelMentionCount = + document.querySelectorAll('.mention-indicator').length; + // set Ferdi badge - Ferdi.setBadge(count); + Ferdi.setBadge(directCount, channelMentionCount); }; Ferdi.loop(getMessages); -- cgit v1.2.3-70-g09d2