aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/infomaniak-mail/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/infomaniak-mail/webview.js')
-rw-r--r--recipes/infomaniak-mail/webview.js11
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 @@
1module.exports = Ferdi => { 1module.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);