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
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
14ce471311
Коммит
f82667f3b8
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ function handleFirstConnect() {
|
||||
function handleReconnect() {
|
||||
if (Client.teamId) {
|
||||
AsyncClient.getChannels();
|
||||
AsyncClient.getMyChannelMembers();
|
||||
loadPosts(ChannelStore.getCurrentId());
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user