From 415f15f113ed7076a8dc585d4241100bf496b1f0 Mon Sep 17 00:00:00 2001 From: Niklas Neesen Date: Tue, 7 Jul 2020 09:38:30 +0200 Subject: Fix badge for unread channels when in single team --- all.json | 2 +- archives/mattermost.tar.gz | Bin 69829 -> 69612 bytes uncompressed/mattermost/package.json | 2 +- uncompressed/mattermost/webview.js | 5 +++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/all.json b/all.json index c2a1dd8..faa2fc6 100644 --- a/all.json +++ b/all.json @@ -565,7 +565,7 @@ "featured": true, "id": "mattermost", "name": "Mattermost", - "version": "1.2.1", + "version": "1.2.2", "icons": { "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/mattermost/icon.png", "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/mattermost/icon.svg" diff --git a/archives/mattermost.tar.gz b/archives/mattermost.tar.gz index ede16d1..7bf21f0 100644 Binary files a/archives/mattermost.tar.gz and b/archives/mattermost.tar.gz differ 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 @@ { "id": "mattermost", "name": "Mattermost", - "version": "1.2.1", + "version": "1.2.2", "description": "Mattermost", "main": "index.js", "author": "Stefan Malzner ", 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 => { const getMessages = function getMessages() { const directMessages = document.querySelectorAll('.sidebar--left .has-badge .badge').length; const allMessages = document.querySelectorAll('.sidebar--left .has-badge').length - directMessages; + const channelMessages = document.querySelectorAll('.sidebar--left .unread-title').length - allMessages; const teamDirectMessages = document.querySelectorAll('.team-wrapper .team-container .badge').length; const teamMessages = document.querySelectorAll('.team-wrapper .unread').length - teamDirectMessages; - Franz.setBadge(directMessages + teamDirectMessages, allMessages + teamMessages); + Franz.setBadge(directMessages + teamDirectMessages, allMessages + channelMessages + teamMessages); }; Franz.loop(getMessages); -}; \ No newline at end of file +}; -- cgit v1.2.3-70-g09d2