diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/discord/package.json | 2 | ||||
-rw-r--r-- | recipes/discord/webview.js | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/recipes/discord/package.json b/recipes/discord/package.json index 4371c3c..d169ab9 100644 --- a/recipes/discord/package.json +++ b/recipes/discord/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "discord", | 2 | "id": "discord", |
3 | "name": "Discord", | 3 | "name": "Discord", |
4 | "version": "1.8.1", | 4 | "version": "1.8.2", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://discord.com/login", | 7 | "serviceURL": "https://discord.com/login", |
diff --git a/recipes/discord/webview.js b/recipes/discord/webview.js index 052ddac..938b3a1 100644 --- a/recipes/discord/webview.js +++ b/recipes/discord/webview.js | |||
@@ -8,16 +8,14 @@ module.exports = (Ferdium, settings) => { | |||
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let directCount = 0; | 9 | let directCount = 0; |
10 | const directCountPerServer = document.querySelectorAll( | 10 | const directCountPerServer = document.querySelectorAll( |
11 | '[class*="lowerBadge-"] [class*="numberBadge-"]', | 11 | '[class*="lowerBadge_"] [class*="numberBadge_"]', |
12 | ); | 12 | ); |
13 | 13 | ||
14 | for (const directCountBadge of directCountPerServer) { | 14 | for (const directCountBadge of directCountPerServer) { |
15 | directCount += Ferdium.safeParseInt(directCountBadge.textContent); | 15 | directCount += Ferdium.safeParseInt(directCountBadge.textContent); |
16 | } | 16 | } |
17 | 17 | ||
18 | const indirectCountPerServer = document.querySelectorAll( | 18 | const indirectCountPerServer = document.title.search('• Discord') === -1 ? 0 : 1; |
19 | '[class*="modeUnread-"]', | ||
20 | ).length; | ||
21 | 19 | ||
22 | Ferdium.setBadge(directCount, indirectCountPerServer); | 20 | Ferdium.setBadge(directCount, indirectCountPerServer); |
23 | }; | 21 | }; |