diff options
author | 2022-05-05 14:53:40 -0500 | |
---|---|---|
committer | 2022-05-05 14:53:40 -0500 | |
commit | c7f346870a0af4e33290be9e6654686d6436ac3a (patch) | |
tree | 14c2ac243d8d00b67beda2f6b71683580322ac95 /recipes | |
parent | Renamed 'master' branch to 'main' (diff) | |
download | ferdium-recipes-c7f346870a0af4e33290be9e6654686d6436ac3a.tar.gz ferdium-recipes-c7f346870a0af4e33290be9e6654686d6436ac3a.tar.zst ferdium-recipes-c7f346870a0af4e33290be9e6654686d6436ac3a.zip |
fix unread count for msteams service
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/msteams/package.json | 2 | ||||
-rw-r--r-- | recipes/msteams/webview.js | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/recipes/msteams/package.json b/recipes/msteams/package.json index abefdd0..a67616a 100644 --- a/recipes/msteams/package.json +++ b/recipes/msteams/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "msteams", | 2 | "id": "msteams", |
3 | "name": "Microsoft Teams", | 3 | "name": "Microsoft Teams", |
4 | "version": "3.2.0", | 4 | "version": "3.2.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "teamsChat" | 7 | "teamsChat" |
diff --git a/recipes/msteams/webview.js b/recipes/msteams/webview.js index c5e32e9..149cc76 100644 --- a/recipes/msteams/webview.js +++ b/recipes/msteams/webview.js | |||
@@ -7,16 +7,14 @@ function _interopRequireDefault(obj) { | |||
7 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
8 | const getMessages = () => { | 8 | const getMessages = () => { |
9 | let messages = 0; | 9 | let messages = 0; |
10 | const badge = document.querySelector( | 10 | const badges = document.querySelectorAll('.activity-badge.dot-activity-badge .activity-badge'); |
11 | '.activity-badge.dot-activity-badge .activity-badge', | 11 | if (badges) { |
12 | ); | 12 | Array.prototype.forEach.call(badges, badge => { |
13 | if (badge) { | 13 | messages += Ferdium.safeParseInt(badge.textContent); |
14 | messages = Ferdium.safeParseInt(badge.textContent); | 14 | }); |
15 | } | 15 | } |
16 | 16 | ||
17 | const indirectMessages = document.querySelectorAll( | 17 | const indirectMessages = document.querySelectorAll('.app-bar-mention').length; |
18 | '[class*=channel-anchor][class*=ts-unread-channel]', | ||
19 | ).length; | ||
20 | 18 | ||
21 | Ferdium.setBadge(messages, indirectMessages); | 19 | Ferdium.setBadge(messages, indirectMessages); |
22 | }; | 20 | }; |