diff options
author | 2020-07-07 09:38:30 +0200 | |
---|---|---|
committer | 2020-07-07 09:38:30 +0200 | |
commit | 415f15f113ed7076a8dc585d4241100bf496b1f0 (patch) | |
tree | 93a8a04209ff2ec256b5440d412ce03002886108 /uncompressed/mattermost | |
parent | Update repository (diff) | |
download | ferdium-recipes-415f15f113ed7076a8dc585d4241100bf496b1f0.tar.gz ferdium-recipes-415f15f113ed7076a8dc585d4241100bf496b1f0.tar.zst ferdium-recipes-415f15f113ed7076a8dc585d4241100bf496b1f0.zip |
Fix badge for unread channels when in single team
Diffstat (limited to 'uncompressed/mattermost')
-rw-r--r-- | uncompressed/mattermost/package.json | 2 | ||||
-rw-r--r-- | uncompressed/mattermost/webview.js | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/uncompressed/mattermost/package.json b/uncompressed/mattermost/package.json index 48f6860..52a1908 100644 --- a/uncompressed/mattermost/package.json +++ b/uncompressed/mattermost/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "mattermost", | 2 | "id": "mattermost", |
3 | "name": "Mattermost", | 3 | "name": "Mattermost", |
4 | "version": "1.2.1", | 4 | "version": "1.2.2", |
5 | "description": "Mattermost", | 5 | "description": "Mattermost", |
6 | "main": "index.js", | 6 | "main": "index.js", |
7 | "author": "Stefan Malzner <stefan@adlk.io>", | 7 | "author": "Stefan Malzner <stefan@adlk.io>", |
diff --git a/uncompressed/mattermost/webview.js b/uncompressed/mattermost/webview.js index 03258e0..f348da4 100644 --- a/uncompressed/mattermost/webview.js +++ b/uncompressed/mattermost/webview.js | |||
@@ -4,10 +4,11 @@ module.exports = Franz => { | |||
4 | const getMessages = function getMessages() { | 4 | const getMessages = function getMessages() { |
5 | const directMessages = document.querySelectorAll('.sidebar--left .has-badge .badge').length; | 5 | const directMessages = document.querySelectorAll('.sidebar--left .has-badge .badge').length; |
6 | const allMessages = document.querySelectorAll('.sidebar--left .has-badge').length - directMessages; | 6 | const allMessages = document.querySelectorAll('.sidebar--left .has-badge').length - directMessages; |
7 | const channelMessages = document.querySelectorAll('.sidebar--left .unread-title').length - allMessages; | ||
7 | const teamDirectMessages = document.querySelectorAll('.team-wrapper .team-container .badge').length; | 8 | const teamDirectMessages = document.querySelectorAll('.team-wrapper .team-container .badge').length; |
8 | const teamMessages = document.querySelectorAll('.team-wrapper .unread').length - teamDirectMessages; | 9 | const teamMessages = document.querySelectorAll('.team-wrapper .unread').length - teamDirectMessages; |
9 | Franz.setBadge(directMessages + teamDirectMessages, allMessages + teamMessages); | 10 | Franz.setBadge(directMessages + teamDirectMessages, allMessages + channelMessages + teamMessages); |
10 | }; | 11 | }; |
11 | 12 | ||
12 | Franz.loop(getMessages); | 13 | Franz.loop(getMessages); |
13 | }; \ No newline at end of file | 14 | }; |