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/telegram-react | |
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/telegram-react')
-rw-r--r-- | recipes/telegram-react/webview.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/recipes/telegram-react/webview.js b/recipes/telegram-react/webview.js index bf41404..c17b200 100644 --- a/recipes/telegram-react/webview.js +++ b/recipes/telegram-react/webview.js | |||
@@ -3,9 +3,14 @@ module.exports = Ferdi => { | |||
3 | let count = 0; | 3 | let count = 0; |
4 | const elements = document.querySelectorAll('.chatlist > li:not(.is-muted)'); | 4 | const elements = document.querySelectorAll('.chatlist > li:not(.is-muted)'); |
5 | if (elements) { | 5 | if (elements) { |
6 | for (let i = 0; i < elements.length; i += 1) { | 6 | for (const element of elements) { |
7 | if (elements[i].querySelector('.unread') && elements[i].querySelector('.unread').innerHTML !== 0) { | 7 | if ( |
8 | count += Ferdi.safeParseInt(elements[i].querySelector('.unread').innerHTML); | 8 | element.querySelector('.unread') && |
9 | element.querySelector('.unread').textContent !== 0 | ||
10 | ) { | ||
11 | count += Ferdi.safeParseInt( | ||
12 | element.querySelector('.unread').textContent, | ||
13 | ); | ||
9 | } | 14 | } |
10 | } | 15 | } |
11 | } | 16 | } |