diff options
author | 2021-05-11 23:38:55 +0530 | |
---|---|---|
committer | 2021-05-12 05:27:29 +0530 | |
commit | e18412994603605d0c3b63bcb83b906b4dd4134d (patch) | |
tree | 325d1a25049f7b0da142ad3cfeaf74142c96752a /recipes/gitter/webview.js | |
parent | Use new icons for gmail (#492) (diff) | |
download | ferdium-recipes-e18412994603605d0c3b63bcb83b906b4dd4134d.tar.gz ferdium-recipes-e18412994603605d0c3b63bcb83b906b4dd4134d.tar.zst ferdium-recipes-e18412994603605d0c3b63bcb83b906b4dd4134d.zip |
Fixing counts for gitter badge.
Diffstat (limited to 'recipes/gitter/webview.js')
-rw-r--r-- | recipes/gitter/webview.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/recipes/gitter/webview.js b/recipes/gitter/webview.js index 17cbca9..d10eb2f 100644 --- a/recipes/gitter/webview.js +++ b/recipes/gitter/webview.js | |||
@@ -11,7 +11,10 @@ function _interopRequireDefault(obj) { | |||
11 | module.exports = Franz => { | 11 | module.exports = Franz => { |
12 | const getMessages = function getMessages() { | 12 | const getMessages = function getMessages() { |
13 | // get unread messages | 13 | // get unread messages |
14 | const count = document.querySelectorAll('.guilds-wrapper .badge, .room-menu-options__item__unread-indicator-wrapper.has-unreads').length; | 14 | let count = 0; |
15 | document.querySelectorAll("div.unread-indicator").forEach((node) => { | ||
16 | count += Number(node.innerText); | ||
17 | }); | ||
15 | 18 | ||
16 | // set Franz badge | 19 | // set Franz badge |
17 | Franz.setBadge(count); | 20 | Franz.setBadge(count); |