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.js14
1 files changed, 11 insertions, 3 deletions
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 @@
1module.exports = Ferdi => { 1module.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};