summaryrefslogtreecommitdiffstats
path: root/web/react/utils/async_client.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-12-02 11:29:51 -0500
committerJoram Wilander <jwawilander@gmail.com>2015-12-02 11:29:51 -0500
commit2b7ce16ea906e76211da3500fe134397f57caefe (patch)
treed1334080098121b5f09f7a0c97d1a749bc86d232 /web/react/utils/async_client.jsx
parentac3f0335be0f2f68e13871153e61c7c9dc632f17 (diff)
parent2abb0ae354239cbdf95cc4d0076846277865786a (diff)
downloadchat-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/async_client.jsx')
-rw-r--r--web/react/utils/async_client.jsx20
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)) {