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.jsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx
index 2d1638060..5def48858 100644
--- a/webapp/actions/global_actions.jsx
+++ b/webapp/actions/global_actions.jsx
@@ -47,16 +47,17 @@ export function emitChannelClickEvent(channel) {
function switchToChannel(chan) {
const channelMember = ChannelStore.getMyMember(chan.id);
const getMyChannelMembersPromise = AsyncClient.getChannelMember(chan.id, UserStore.getCurrentId());
+ const oldChannelId = ChannelStore.getCurrentId();
getMyChannelMembersPromise.then(() => {
AsyncClient.getChannelStats(chan.id, true);
- AsyncClient.viewChannel(chan.id, ChannelStore.getCurrentId());
+ AsyncClient.viewChannel(chan.id, oldChannelId);
loadPosts(chan.id);
trackPage();
});
// Mark previous and next channel as read
- ChannelStore.resetCounts(ChannelStore.getCurrentId());
+ ChannelStore.resetCounts(oldChannelId);
ChannelStore.resetCounts(chan.id);
BrowserStore.setGlobalItem(chan.team_id, chan.id);
@@ -68,7 +69,7 @@ export function emitChannelClickEvent(channel) {
team_id: chan.team_id,
total_msg_count: chan.total_msg_count,
channelMember,
- prev: ChannelStore.getCurrentId()
+ prev: oldChannelId
});
}