Remove remaining badges after logging out of the team

Close #396
This commit is contained in:
Yuya Ochiai
2017-01-11 21:27:25 +09:00
parent 58929e4a24
commit 8d7bc31798
2 changed files with 9 additions and 0 deletions

View File

@@ -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

View File

@@ -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;