aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/gitter/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/gitter/webview.js')
-rw-r--r--recipes/gitter/webview.js10
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 @@
1const _path = _interopRequireDefault(require('path')); 1const _path = _interopRequireDefault(require('path'));
2 2
3function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj };
5}
4 6
5module.exports = Ferdi => { 7module.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);