diff options
author | 2021-10-24 10:38:34 +0200 | |
---|---|---|
committer | 2021-10-24 10:38:34 +0200 | |
commit | 4a6fcf1a35f6d26f7c0d04c9769ca101df8f6ce8 (patch) | |
tree | ce52dc6acfa24a50c3bfbf238c4ec059f5229e0c /recipes/telegram-react/webview.js | |
parent | Add setDialogTitle feature to api, WhatsApp and Telegram (#750) (diff) | |
download | ferdium-recipes-4a6fcf1a35f6d26f7c0d04c9769ca101df8f6ce8.tar.gz ferdium-recipes-4a6fcf1a35f6d26f7c0d04c9769ca101df8f6ce8.tar.zst ferdium-recipes-4a6fcf1a35f6d26f7c0d04c9769ca101df8f6ce8.zip |
feat: support telegram count for both webk and webz (#751)
Diffstat (limited to 'recipes/telegram-react/webview.js')
-rw-r--r-- | recipes/telegram-react/webview.js | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/recipes/telegram-react/webview.js b/recipes/telegram-react/webview.js deleted file mode 100644 index c17b200..0000000 --- a/recipes/telegram-react/webview.js +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | module.exports = Ferdi => { | ||
2 | const getMessages = () => { | ||
3 | let count = 0; | ||
4 | const elements = document.querySelectorAll('.chatlist > li:not(.is-muted)'); | ||
5 | if (elements) { | ||
6 | for (const element of elements) { | ||
7 | if ( | ||
8 | element.querySelector('.unread') && | ||
9 | element.querySelector('.unread').textContent !== 0 | ||
10 | ) { | ||
11 | count += Ferdi.safeParseInt( | ||
12 | element.querySelector('.unread').textContent, | ||
13 | ); | ||
14 | } | ||
15 | } | ||
16 | } | ||
17 | Ferdi.setBadge(count); | ||
18 | }; | ||
19 | |||
20 | Ferdi.loop(getMessages); | ||
21 | }; | ||