diff options
Diffstat (limited to 'recipes/anydo')
-rw-r--r-- | recipes/anydo/index.js | 1 | ||||
-rw-r--r-- | recipes/anydo/webview.js | 25 |
2 files changed, 11 insertions, 15 deletions
diff --git a/recipes/anydo/index.js b/recipes/anydo/index.js index a028916..46f936f 100644 --- a/recipes/anydo/index.js +++ b/recipes/anydo/index.js | |||
@@ -1,3 +1,2 @@ | |||
1 | "use strict"; | ||
2 | // just pass through Franz | 1 | // just pass through Franz |
3 | module.exports = Franz => Franz; | 2 | module.exports = Franz => Franz; |
diff --git a/recipes/anydo/webview.js b/recipes/anydo/webview.js index aaff6dc..e35bfb5 100644 --- a/recipes/anydo/webview.js +++ b/recipes/anydo/webview.js | |||
@@ -1,20 +1,17 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = (Franz) => { | 1 | module.exports = (Franz) => { |
4 | function getTasks() { | 2 | function getTasks() { |
5 | 3 | let incompleteCount = 0; | |
6 | let incompleteCount = 0; | ||
7 | 4 | ||
8 | const countEls = document.querySelectorAll('.AppSidebarListsItems__itemContainer__sizeContainer:not([hidden]) > .AppSidebarListsItems__itemContainer__size'); | 5 | const countEls = document.querySelectorAll('.AppSidebarListsItems__itemContainer__sizeContainer:not([hidden]) > .AppSidebarListsItems__itemContainer__size'); |
9 | 6 | ||
10 | if (countEls.length) { | 7 | if (countEls.length) { |
11 | Array.from(countEls).forEach((el) => { | 8 | Array.from(countEls).forEach((el) => { |
12 | incompleteCount += parseInt(el.innerHTML, 10); | 9 | incompleteCount += parseInt(el.innerHTML, 10); |
13 | }); | 10 | }); |
14 | } | ||
15 | |||
16 | Franz.setBadge(incompleteCount); | ||
17 | } | 11 | } |
18 | 12 | ||
19 | Franz.loop(getTasks); | 13 | Franz.setBadge(incompleteCount); |
14 | } | ||
15 | |||
16 | Franz.loop(getTasks); | ||
20 | }; | 17 | }; |