summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-10-27 12:24:30 -0300
committerHarrison Healey <harrisonmhealey@gmail.com>2016-10-27 11:24:30 -0400
commitf82667f3b86202dafff3a2a4ea56aec74c80316d (patch)
tree3785d9502505be528706e41b993a834c7bc00338 /webapp/actions
parent14ce471311fee2830be3cbd3a90179015f513719 (diff)
downloadchat-f82667f3b86202dafff3a2a4ea56aec74c80316d.tar.gz
chat-f82667f3b86202dafff3a2a4ea56aec74c80316d.tar.bz2
chat-f82667f3b86202dafff3a2a4ea56aec74c80316d.zip
PLT-4430 improve slow channel switching (#4331)
* PLT-4430 improve slow channel switching * Update client side unit tests * Convert getChannelsUnread to getMyChannelMembers and address other feedback * Pull channel members on websocket reconnect
Diffstat (limited to 'webapp/actions')
-rw-r--r--webapp/actions/global_actions.jsx6
-rw-r--r--webapp/actions/post_actions.jsx2
-rw-r--r--webapp/actions/websocket_actions.jsx1
3 files changed, 2 insertions, 7 deletions
diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx
index 23ff5a295..123c1c392 100644
--- a/webapp/actions/global_actions.jsx
+++ b/webapp/actions/global_actions.jsx
@@ -42,8 +42,6 @@ export function emitChannelClickEvent(channel) {
);
}
function switchToChannel(chan) {
- AsyncClient.getChannels(true);
- AsyncClient.getMoreChannels(true);
AsyncClient.getChannelStats(chan.id);
AsyncClient.updateLastViewedAt(chan.id);
loadPosts(chan.id);
@@ -436,10 +434,6 @@ export function loadDefaultLocale() {
}
export function viewLoggedIn() {
- AsyncClient.getChannels();
- AsyncClient.getMoreChannels();
- AsyncClient.getChannelStats();
-
// Clear pending posts (shouldn't have pending posts if we are loading)
PostStore.clearPendingPosts();
}
diff --git a/webapp/actions/post_actions.jsx b/webapp/actions/post_actions.jsx
index 462576021..1a2056a2e 100644
--- a/webapp/actions/post_actions.jsx
+++ b/webapp/actions/post_actions.jsx
@@ -120,7 +120,7 @@ export function setUnreadPost(channelId, postId) {
member.msg_count = channel.total_msg_count - unreadPosts;
member.mention_count = 0;
ChannelStore.storeMyChannelMember(member);
- ChannelStore.setUnreadCount(channelId);
+ ChannelStore.setUnreadCountByChannel(channelId);
AsyncClient.setLastViewedAt(lastViewed, channelId);
}
diff --git a/webapp/actions/websocket_actions.jsx b/webapp/actions/websocket_actions.jsx
index c3a3010b0..e58bded0d 100644
--- a/webapp/actions/websocket_actions.jsx
+++ b/webapp/actions/websocket_actions.jsx
@@ -76,6 +76,7 @@ function handleFirstConnect() {
function handleReconnect() {
if (Client.teamId) {
AsyncClient.getChannels();
+ AsyncClient.getMyChannelMembers();
loadPosts(ChannelStore.getCurrentId());
}