diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-11-11 14:55:05 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-11-11 14:55:05 -0500 |
commit | ced5f54500b2688a942c5c1afbb4fca3882b4f51 (patch) | |
tree | fa4cd9d8cab4e9b93a31102c90f22b98f9c75c8d /webapp/actions/global_actions.jsx | |
parent | 29efeff09532397a33bb971e91324f673b296559 (diff) | |
download | chat-ced5f54500b2688a942c5c1afbb4fca3882b4f51.tar.gz chat-ced5f54500b2688a942c5c1afbb4fca3882b4f51.tar.bz2 chat-ced5f54500b2688a942c5c1afbb4fca3882b4f51.zip |
Fixing new messages indicator (#4531)
Diffstat (limited to 'webapp/actions/global_actions.jsx')
-rw-r--r-- | webapp/actions/global_actions.jsx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx index 6a63b5630..f7c4c455c 100644 --- a/webapp/actions/global_actions.jsx +++ b/webapp/actions/global_actions.jsx @@ -43,16 +43,20 @@ export function emitChannelClickEvent(channel) { ); } function switchToChannel(chan) { - AsyncClient.getChannelStats(chan.id, true); - AsyncClient.updateLastViewedAt(chan.id); - loadPosts(chan.id); - trackPage(); - - AppDispatcher.handleViewAction({ - type: ActionTypes.CLICK_CHANNEL, - name: chan.name, - id: chan.id, - prev: ChannelStore.getCurrentId() + const getMyChannelMembersPromise = AsyncClient.getChannelMember(chan.id, UserStore.getCurrentId()); + + getMyChannelMembersPromise.then(() => { + AsyncClient.getChannelStats(chan.id, true); + AsyncClient.updateLastViewedAt(chan.id); + loadPosts(chan.id); + trackPage(); + + AppDispatcher.handleViewAction({ + type: ActionTypes.CLICK_CHANNEL, + name: chan.name, + id: chan.id, + prev: ChannelStore.getCurrentId() + }); }); } |