aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/infomaniak-mail
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-10-05 17:04:09 +0200
committerLibravatar GitHub <noreply@github.com>2021-10-05 17:04:09 +0200
commitd3841b766f9d37d557646003899f67525c5f755f (patch)
tree1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/infomaniak-mail
parentchore: repo maintenance (#732) (diff)
downloadferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.gz
ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.zst
ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.zip
chore: add eslint-plugin-unicorn (#733)
Diffstat (limited to 'recipes/infomaniak-mail')
-rw-r--r--recipes/infomaniak-mail/index.js3
-rw-r--r--recipes/infomaniak-mail/webview.js14
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 @@
1module.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 @@
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};