aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/telegram-react/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/telegram-react/webview.js')
-rw-r--r--recipes/telegram-react/webview.js11
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 }