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/icq/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/icq/webview.js')
-rw-r--r-- | recipes/icq/webview.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/recipes/icq/webview.js b/recipes/icq/webview.js index 1bffd27..e782eb4 100644 --- a/recipes/icq/webview.js +++ b/recipes/icq/webview.js | |||
@@ -1,9 +1,15 @@ | |||
1 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | let directs = 0; | 3 | let directs = 0; |
4 | const elements = document.getElementsByClassName('nwa-msg-counter icq-recent_state-read'); | 4 | const elements = document.querySelectorAll( |
5 | for (let i = 0; i < elements.length; i++) { | 5 | '.nwa-msg-counter.icq-recent_state-read', |
6 | if (Ferdi.safeParseInt(elements[i].innerText.replace(/[^0-9.]/g, '')) > 0) { | 6 | ); |
7 | for (const element of elements) { | ||
8 | if ( | ||
9 | Ferdi.safeParseInt( | ||
10 | element.textContent && element.textContent.replace(/[^\d.]/g, ''), | ||
11 | ) > 0 | ||
12 | ) { | ||
7 | directs += 1; // count 1 per channel with messages | 13 | directs += 1; // count 1 per channel with messages |
8 | } | 14 | } |
9 | } | 15 | } |