aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/moodle
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2021-10-31 16:19:43 +0100
committerLibravatar Bennett <hello@vantezzen.io>2021-10-31 16:19:43 +0100
commit2b637ea99ce5ab25af629cd6ba10a86e3babf3d0 (patch)
tree9d6eb0e066103fed5f35464da8423a5f58eb32d8 /recipes/moodle
parentUpdate all.json (diff)
downloadferdium-recipes-2b637ea99ce5ab25af629cd6ba10a86e3babf3d0.tar.gz
ferdium-recipes-2b637ea99ce5ab25af629cd6ba10a86e3babf3d0.tar.zst
ferdium-recipes-2b637ea99ce5ab25af629cd6ba10a86e3babf3d0.zip
Use more explicit variable names
Diffstat (limited to 'recipes/moodle')
-rw-r--r--recipes/moodle/webview.js6
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
5module.exports = Ferdi => { 5module.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