summaryrefslogtreecommitdiffstats
path: root/webapp/actions/global_actions.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/actions/global_actions.jsx')
-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()
+ });
});
}