diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/moodle/webview.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/recipes/moodle/webview.js b/recipes/moodle/webview.js index ba19f3f..932d1ec 100644 --- a/recipes/moodle/webview.js +++ b/recipes/moodle/webview.js | |||
@@ -4,13 +4,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de | |||
4 | 4 | ||
5 | module.exports = Ferdi => { | 5 | module.exports = Ferdi => { |
6 | const getMessages = () => { | 6 | const getMessages = () => { |
7 | const elements = [...document.querySelectorAll('[data-region="count-container"]')]; | 7 | const directCountSelector = [...document.querySelectorAll('[data-region="count-container"]')]; |
8 | const messages = elements.reduce( | 8 | const totalMessageCount = directCountSelector.reduce( |
9 | ((count, item) => count + Number(item.textContent)), | 9 | ((count, item) => count + Number(item.textContent)), |
10 | 0 | 10 | 0 |
11 | ); | 11 | ); |
12 | 12 | ||
13 | Ferdi.setBadge(messages, 0); | 13 | Ferdi.setBadge(totalMessageCount, 0); |
14 | }; | 14 | }; |
15 | Ferdi.loop(getMessages); | 15 | Ferdi.loop(getMessages); |
16 | 16 | ||