diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-10-05 17:04:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-05 17:04:09 +0200 |
commit | d3841b766f9d37d557646003899f67525c5f755f (patch) | |
tree | 1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/anydo/webview.js | |
parent | chore: repo maintenance (#732) (diff) | |
download | ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.gz ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.zst ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.zip |
chore: add eslint-plugin-unicorn (#733)
Diffstat (limited to 'recipes/anydo/webview.js')
-rw-r--r-- | recipes/anydo/webview.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/recipes/anydo/webview.js b/recipes/anydo/webview.js index 4f4749b..e1ee479 100644 --- a/recipes/anydo/webview.js +++ b/recipes/anydo/webview.js | |||
@@ -1,13 +1,15 @@ | |||
1 | module.exports = (Ferdi) => { | 1 | module.exports = Ferdi => { |
2 | function getTasks() { | 2 | function getTasks() { |
3 | let incompleteCount = 0; | 3 | let incompleteCount = 0; |
4 | 4 | ||
5 | const countEls = document.querySelectorAll('.AppSidebarListsItems__itemContainer__sizeContainer:not([hidden]) > .AppSidebarListsItems__itemContainer__size'); | 5 | const countEls = document.querySelectorAll( |
6 | '.AppSidebarListsItems__itemContainer__sizeContainer:not([hidden]) > .AppSidebarListsItems__itemContainer__size', | ||
7 | ); | ||
6 | 8 | ||
7 | if (countEls.length) { | 9 | if (countEls.length > 0) { |
8 | Array.from(countEls).forEach((el) => { | 10 | for (const el of countEls) { |
9 | incompleteCount += Ferdi.safeParseInt(el.innerHTML); | 11 | incompleteCount += Ferdi.safeParseInt(el.textContent); |
10 | }); | 12 | } |
11 | } | 13 | } |
12 | 14 | ||
13 | Ferdi.setBadge(incompleteCount); | 15 | Ferdi.setBadge(incompleteCount); |