diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-12-02 11:29:51 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-12-02 11:29:51 -0500 |
commit | 2b7ce16ea906e76211da3500fe134397f57caefe (patch) | |
tree | d1334080098121b5f09f7a0c97d1a749bc86d232 /web/react/utils | |
parent | ac3f0335be0f2f68e13871153e61c7c9dc632f17 (diff) | |
parent | 2abb0ae354239cbdf95cc4d0076846277865786a (diff) | |
download | chat-2b7ce16ea906e76211da3500fe134397f57caefe.tar.gz chat-2b7ce16ea906e76211da3500fe134397f57caefe.tar.bz2 chat-2b7ce16ea906e76211da3500fe134397f57caefe.zip |
Merge pull request #1577 from mattermost/plt-1307
PLT-1307 Make proper async calls when switching channels
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/async_client.jsx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx index 8cf111d55..5df43b548 100644 --- a/web/react/utils/async_client.jsx +++ b/web/react/utils/async_client.jsx @@ -106,10 +106,15 @@ export function getChannel(id) { ); } -export function updateLastViewedAt() { - const channelId = ChannelStore.getCurrentId(); +export function updateLastViewedAt(id) { + let channelId; + if (id) { + channelId = id; + } else { + channelId = ChannelStore.getCurrentId(); + } - if (channelId === null) { + if (channelId == null) { return; } @@ -159,8 +164,13 @@ export function getMoreChannels(force) { } } -export function getChannelExtraInfo() { - const channelId = ChannelStore.getCurrentId(); +export function getChannelExtraInfo(id) { + let channelId; + if (id) { + channelId = id; + } else { + channelId = ChannelStore.getCurrentId(); + } if (channelId != null) { if (isCallInProgress('getChannelExtraInfo_' + channelId)) { |