aboutsummaryrefslogtreecommitdiffstats
path: root/uncompressed
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2020-07-19 20:48:42 +0200
committerLibravatar GitHub <noreply@github.com>2020-07-19 20:48:42 +0200
commit47e72b30c29d07ceadb84e85acfe4a820e54372e (patch)
tree52b453a14ef3ca93cb90fcbe9110c7d20f9c725f /uncompressed
parentMerge pull request #235 from omove/master (diff)
parentFix badge for unread channels when in single team (diff)
downloadferdium-recipes-47e72b30c29d07ceadb84e85acfe4a820e54372e.tar.gz
ferdium-recipes-47e72b30c29d07ceadb84e85acfe4a820e54372e.tar.zst
ferdium-recipes-47e72b30c29d07ceadb84e85acfe4a820e54372e.zip
Merge pull request #230 from CrEaK/mattermost-fix
Mattermost: Fix badge for unread channels when in single team
Diffstat (limited to 'uncompressed')
-rw-r--r--uncompressed/mattermost/package.json2
-rw-r--r--uncompressed/mattermost/webview.js5
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};