diff --git a/CHANGELOG.md b/CHANGELOG.md index 826c4f4b..89f0472b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Release date: TBD #### All Platforms - Do not place the application window outside of the viewable area anymore, if the display it has been on has been removed +- Remove remaining badges after logging out of the team #### Windows - Fixed an issue where an unexpected window appears while install/uninstalling diff --git a/src/browser/webview/mattermost.js b/src/browser/webview/mattermost.js index 986315a2..ab51b3fb 100644 --- a/src/browser/webview/mattermost.js +++ b/src/browser/webview/mattermost.js @@ -24,6 +24,14 @@ setInterval(function getUnreadCount() { this.mentionCount = 0; } + // LHS not found => Log out => Count should be 0. + if (document.getElementById('sidebar-left') === null) { + ipc.sendToHost('onUnreadCountChange', 0, 0, false, false); + this.unreadCount = 0; + this.mentionCount = 0; + return; + } + // unreadCount in sidebar // Note: the active channel doesn't have '.unread-title'. var unreadCount = document.getElementsByClassName('unread-title').length;