diff options
-rw-r--r-- | all.json | 2 | ||||
-rw-r--r-- | recipes/telegram-react/package.json | 2 | ||||
-rw-r--r-- | recipes/telegram-react/webview.js | 8 |
3 files changed, 5 insertions, 7 deletions
@@ -1368,7 +1368,7 @@ | |||
1368 | "featured": false, | 1368 | "featured": false, |
1369 | "id": "telegram-react", | 1369 | "id": "telegram-react", |
1370 | "name": "Telegram React", | 1370 | "name": "Telegram React", |
1371 | "version": "1.1.0", | 1371 | "version": "1.1.1", |
1372 | "icons": { | 1372 | "icons": { |
1373 | "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/telegram-react/icon.png", | 1373 | "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/telegram-react/icon.png", |
1374 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/telegram-react/icon.svg" | 1374 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/telegram-react/icon.svg" |
diff --git a/recipes/telegram-react/package.json b/recipes/telegram-react/package.json index 1b40ab7..f6f11f3 100644 --- a/recipes/telegram-react/package.json +++ b/recipes/telegram-react/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "telegram-react", | 2 | "id": "telegram-react", |
3 | "name": "Telegram React", | 3 | "name": "Telegram React", |
4 | "version": "1.1.0", | 4 | "version": "1.1.1", |
5 | "description": "Telegram React", | 5 | "description": "Telegram React", |
6 | "main": "index.js", | 6 | "main": "index.js", |
7 | "author": "Amine Mouafik <amine@mouafik.fr>", | 7 | "author": "Amine Mouafik <amine@mouafik.fr>", |
diff --git a/recipes/telegram-react/webview.js b/recipes/telegram-react/webview.js index 223e914..8bc3839 100644 --- a/recipes/telegram-react/webview.js +++ b/recipes/telegram-react/webview.js | |||
@@ -1,15 +1,13 @@ | |||
1 | "use strict"; | 1 | "use strict"; |
2 | 2 | ||
3 | const path = require("path"); | ||
4 | |||
5 | module.exports = Franz => { | 3 | module.exports = Franz => { |
6 | const getMessages = function getMessages() { | 4 | const getMessages = function getMessages() { |
7 | let count = 0; | 5 | let count = 0; |
8 | const elements = document.querySelectorAll(".dialog-badge:not(.dialog-badge-muted)"); | 6 | const elements = document.querySelectorAll(".chatlist > li:not(.is-muted)"); |
9 | if (elements) { | 7 | if (elements) { |
10 | for (let i = 0; i < elements.length; i += 1) { | 8 | for (let i = 0; i < elements.length; i += 1) { |
11 | if (elements[i].querySelector("span").innerHTML !== 0) { | 9 | if (elements[i].querySelector(".unread") && elements[i].querySelector(".unread").innerHTML !== 0) { |
12 | count += parseInt(elements[i].querySelector("span").innerHTML); | 10 | count += parseInt(elements[i].querySelector(".unread").innerHTML); |
13 | } | 11 | } |
14 | } | 12 | } |
15 | } | 13 | } |