diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-10-05 17:04:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-05 17:04:09 +0200 |
commit | d3841b766f9d37d557646003899f67525c5f755f (patch) | |
tree | 1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/proton-mail/webview.js | |
parent | chore: repo maintenance (#732) (diff) | |
download | ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.gz ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.zst ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.zip |
chore: add eslint-plugin-unicorn (#733)
Diffstat (limited to 'recipes/proton-mail/webview.js')
-rw-r--r-- | recipes/proton-mail/webview.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/recipes/proton-mail/webview.js b/recipes/proton-mail/webview.js index ed66db5..395b779 100644 --- a/recipes/proton-mail/webview.js +++ b/recipes/proton-mail/webview.js | |||
@@ -4,10 +4,13 @@ module.exports = Ferdi => { | |||
4 | if (!element) { | 4 | if (!element) { |
5 | return; | 5 | return; |
6 | } | 6 | } |
7 | const text = element.innerText; | 7 | const text = element.textContent; |
8 | const count = Ferdi.safeParseInt(text.substring(1, text.length - 1)); | 8 | if (text) { |
9 | Ferdi.setBadge(count); | 9 | // eslint-disable-next-line unicorn/prefer-string-slice |
10 | } | 10 | const count = Ferdi.safeParseInt(text.substring(1, text.length - 1)); |
11 | Ferdi.setBadge(count); | ||
12 | } | ||
13 | }; | ||
11 | 14 | ||
12 | Ferdi.loop(getMessages); | 15 | Ferdi.loop(getMessages); |
13 | }; | 16 | }; |