summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-11-01 11:13:33 -0400
committerGitHub <noreply@github.com>2016-11-01 11:13:33 -0400
commit92642bab6852d02e6b58f881ac909788299d0c5c (patch)
tree9c54d4c54bc29a488a34e659a3b75b3d2105ce03 /webapp/utils
parent9bae1f7e9308be8c7084f73e6b897dde24aad717 (diff)
downloadchat-92642bab6852d02e6b58f881ac909788299d0c5c.tar.gz
chat-92642bab6852d02e6b58f881ac909788299d0c5c.tar.bz2
chat-92642bab6852d02e6b58f881ac909788299d0c5c.zip
Load channel members with channels to make sure we have latest unread counts (#4389)
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/async_client.jsx18
1 files changed, 7 insertions, 11 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index c23270216..1149c565f 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -63,7 +63,7 @@ export function checkVersion() {
}
}
-export function getChannels(doVersionCheck) {
+export function getChannels() {
if (isCallInProgress('getChannels')) {
return null;
}
@@ -74,10 +74,6 @@ export function getChannels(doVersionCheck) {
(data) => {
callTracker.getChannels = 0;
- if (doVersionCheck) {
- checkVersion();
- }
-
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_CHANNELS,
channels: data
@@ -114,7 +110,7 @@ export function getChannel(id) {
);
}
-export function getMyChannelMembers(doVersionCheck) {
+export function getMyChannelMembers() {
if (isCallInProgress('getMyChannelMembers')) {
return;
}
@@ -125,10 +121,6 @@ export function getMyChannelMembers(doVersionCheck) {
(data) => {
callTracker.getMyChannelMembers = 0;
- if (doVersionCheck) {
- checkVersion();
- }
-
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_MY_CHANNEL_MEMBERS,
members: data
@@ -242,7 +234,7 @@ export function getMoreChannels(force) {
}
}
-export function getChannelStats(channelId = ChannelStore.getCurrentId()) {
+export function getChannelStats(channelId = ChannelStore.getCurrentId(), doVersionCheck = false) {
if (isCallInProgress('getChannelStats' + channelId) || channelId == null) {
return;
}
@@ -254,6 +246,10 @@ export function getChannelStats(channelId = ChannelStore.getCurrentId()) {
(data) => {
callTracker['getChannelStats' + channelId] = 0;
+ if (doVersionCheck) {
+ checkVersion();
+ }
+
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_CHANNEL_STATS,
stats: data