diff options
Diffstat (limited to 'recipes/infomaniak-mail')
-rw-r--r-- | recipes/infomaniak-mail/index.js | 3 | ||||
-rw-r--r-- | recipes/infomaniak-mail/webview.js | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/recipes/infomaniak-mail/index.js b/recipes/infomaniak-mail/index.js index 93f2dcf..24184f8 100644 --- a/recipes/infomaniak-mail/index.js +++ b/recipes/infomaniak-mail/index.js | |||
@@ -1,2 +1 @@ | |||
1 | module.exports = Ferdi => class infomaniakmail extends Ferdi { | module.exports = Ferdi => class infomaniakmail extends Ferdi {}; | |
2 | }; | ||
diff --git a/recipes/infomaniak-mail/webview.js b/recipes/infomaniak-mail/webview.js index 04ac42d..f4e39dc 100644 --- a/recipes/infomaniak-mail/webview.js +++ b/recipes/infomaniak-mail/webview.js | |||
@@ -1,8 +1,16 @@ | |||
1 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | const count = document.querySelector('.ws-tree-node-badge').innerText; | 3 | const count = document.querySelector('.ws-tree-node-badge'); |
4 | Ferdi.setBadge(count ? Number(count.substring(1, count.length - 1)) : 0); | 4 | if (count) { |
5 | } | 5 | const countText = count.textContent; |
6 | if (countText) { | ||
7 | Ferdi.setBadge( | ||
8 | // eslint-disable-next-line unicorn/prefer-string-slice | ||
9 | count ? Number(countText.substring(1, countText.length - 1)) : 0, | ||
10 | ); | ||
11 | } | ||
12 | } | ||
13 | }; | ||
6 | 14 | ||
7 | Ferdi.loop(getMessages); | 15 | Ferdi.loop(getMessages); |
8 | }; | 16 | }; |