diff options
Diffstat (limited to 'recipes/gitter')
-rw-r--r-- | recipes/gitter/webview.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/recipes/gitter/webview.js b/recipes/gitter/webview.js index e78cadf..0026790 100644 --- a/recipes/gitter/webview.js +++ b/recipes/gitter/webview.js | |||
@@ -1,14 +1,16 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | const _path = _interopRequireDefault(require('path')); |
2 | 2 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
4 | 6 | ||
5 | module.exports = Ferdi => { | 7 | module.exports = Ferdi => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | // get unread messages | 9 | // get unread messages |
8 | let count = 0; | 10 | let count = 0; |
9 | document.querySelectorAll('div.unread-indicator').forEach((node) => { | 11 | for (const node of document.querySelectorAll('div.unread-indicator')) { |
10 | count += Ferdi.safeParseInt(node.innerText); | 12 | count += Ferdi.safeParseInt(node.textContent); |
11 | }); | 13 | } |
12 | 14 | ||
13 | // set Ferdi badge | 15 | // set Ferdi badge |
14 | Ferdi.setBadge(count); | 16 | Ferdi.setBadge(count); |