diff options
author | Bauke van der Woude <6784391+baukevdw@users.noreply.github.com> | 2022-01-11 23:57:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-11 23:57:30 +0100 |
commit | f82f019aa993f346c8997d88944c055a377e3f37 (patch) | |
tree | 17b3078d4f38cc58e4e3c114107600cf041bd279 /recipes/infomaniak-mail/webview.js | |
parent | Iterate on README [skip ci] (diff) | |
download | ferdium-recipes-f82f019aa993f346c8997d88944c055a377e3f37.tar.gz ferdium-recipes-f82f019aa993f346c8997d88944c055a377e3f37.tar.zst ferdium-recipes-f82f019aa993f346c8997d88944c055a377e3f37.zip |
Fix Infomaniak unread messages count (#817)
Diffstat (limited to 'recipes/infomaniak-mail/webview.js')
-rw-r--r-- | recipes/infomaniak-mail/webview.js | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/recipes/infomaniak-mail/webview.js b/recipes/infomaniak-mail/webview.js index f4e39dc..4d8b006 100644 --- a/recipes/infomaniak-mail/webview.js +++ b/recipes/infomaniak-mail/webview.js | |||
@@ -1,15 +1,8 @@ | |||
1 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | const count = document.querySelector('.ws-tree-node-badge'); | 3 | const count = document.querySelector('.ws-tree-node-badge'); |
4 | if (count) { | 4 | const countText = count ? count.textContent : null; |
5 | const countText = count.textContent; | 5 | Ferdi.setBadge(count && countText ? Number(countText.substring(1, countText.length - 1)) : 0); |
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 | ||
15 | Ferdi.loop(getMessages); | 8 | Ferdi.loop(getMessages); |