summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-11-11 14:55:05 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-11 14:55:05 -0500
commitced5f54500b2688a942c5c1afbb4fca3882b4f51 (patch)
treefa4cd9d8cab4e9b93a31102c90f22b98f9c75c8d /webapp/actions
parent29efeff09532397a33bb971e91324f673b296559 (diff)
downloadchat-ced5f54500b2688a942c5c1afbb4fca3882b4f51.tar.gz
chat-ced5f54500b2688a942c5c1afbb4fca3882b4f51.tar.bz2
chat-ced5f54500b2688a942c5c1afbb4fca3882b4f51.zip
Fixing new messages indicator (#4531)
Diffstat (limited to 'webapp/actions')
-rw-r--r--webapp/actions/global_actions.jsx24
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()
+ });
});
}