Commit fbe5a6d9 authored by Joram Wilander's avatar Joram Wilander Committed by GitHub

Fix race causing channels to not clear mention on focus (#6587)

parent 7cb7bec1
......@@ -119,12 +119,12 @@ export default class NeedsTeam extends React.Component {
// Set up tracking for whether the window is active
window.isActive = true;
$(window).on('focus', () => {
this.props.actions.viewChannel(ChannelStore.getCurrentId());
$(window).on('focus', async () => {
ChannelStore.resetCounts([ChannelStore.getCurrentId()]);
ChannelStore.emitChange();
window.isActive = true;
await this.props.actions.viewChannel(ChannelStore.getCurrentId());
if (new Date().getTime() - this.blurTime > UNREAD_CHECK_TIME_MILLISECONDS) {
this.props.actions.getMyChannelMembers(TeamStore.getCurrentId()).then(loadProfilesForSidebar);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment