summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-06-06 07:56:07 -0400
committerGitHub <noreply@github.com>2017-06-06 07:56:07 -0400
commit382ba0b0d18f67d473ad677f9b5151bc5e468e14 (patch)
treed342f1da4b39c5a23f2c01ea916cec0b13c0981c /webapp
parent876c5dc9dfede580dfdb8f5d982b8b912958eacc (diff)
downloadchat-382ba0b0d18f67d473ad677f9b5151bc5e468e14.tar.gz
chat-382ba0b0d18f67d473ad677f9b5151bc5e468e14.tar.bz2
chat-382ba0b0d18f67d473ad677f9b5151bc5e468e14.zip
Fix race causing channels to not clear mention on focus (#6587)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/needs_team/needs_team.jsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/webapp/components/needs_team/needs_team.jsx b/webapp/components/needs_team/needs_team.jsx
index 75ec40653..95556fb31 100644
--- a/webapp/components/needs_team/needs_team.jsx
+++ b/webapp/components/needs_team/needs_team.jsx
@@ -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);
}