summaryrefslogtreecommitdiffstats
path: root/webapp/stores
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-05-02 09:28:44 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2017-05-02 09:28:44 -0400
commit042052aec61b8c51751cb3aeb27c6c21ecf16416 (patch)
treecedfee7c1ddecacdddc155a453f33b717b233490 /webapp/stores
parent294bd0825550cd8de557a8b36facfc601f32bd82 (diff)
downloadchat-042052aec61b8c51751cb3aeb27c6c21ecf16416.tar.gz
chat-042052aec61b8c51751cb3aeb27c6c21ecf16416.tar.bz2
chat-042052aec61b8c51751cb3aeb27c6c21ecf16416.zip
Improve perf for channel switching, fix team switching issues (#6286)
* Improve perf for channel switching, fix team switching issues * Fix last channel when switching teams
Diffstat (limited to 'webapp/stores')
-rw-r--r--webapp/stores/channel_store.jsx2
-rw-r--r--webapp/stores/team_store.jsx19
2 files changed, 1 insertions, 20 deletions
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx
index 1440c1590..db1bead46 100644
--- a/webapp/stores/channel_store.jsx
+++ b/webapp/stores/channel_store.jsx
@@ -261,7 +261,7 @@ class ChannelStoreClass extends EventEmitter {
}
getChannelById(id) {
- return Selectors.getChannelsInCurrentTeam(store.getState())[id];
+ return this.get(id);
}
storeMyChannelMember(channelMember) {
diff --git a/webapp/stores/team_store.jsx b/webapp/stores/team_store.jsx
index f017c411e..2dc034199 100644
--- a/webapp/stores/team_store.jsx
+++ b/webapp/stores/team_store.jsx
@@ -342,20 +342,6 @@ class TeamStoreClass extends EventEmitter {
return false;
}
- updateUnreadCount(teamId, totalMsgCount, channelMember) {
- let member = this.getMyTeamMembers().filter((m) => m.team_id === teamId)[0];
- if (member) {
- member = Object.assign({}, member);
- member.msg_count -= (totalMsgCount - channelMember.msg_count);
- member.mention_count -= channelMember.mention_count;
-
- store.dispatch({
- type: TeamTypes.RECEIVED_MY_TEAM_MEMBER,
- data: member
- });
- }
- }
-
subtractUnread(teamId, msgs, mentions) {
let member = this.getMyTeamMembers().filter((m) => m.team_id === teamId)[0];
if (member) {
@@ -443,11 +429,6 @@ TeamStore.dispatchToken = AppDispatcher.register((payload) => {
case ActionTypes.RECEIVED_TEAM_STATS:
TeamStore.saveStats(action.team_id, action.stats);
break;
- case ActionTypes.CLICK_CHANNEL:
- if (action.channelMember) {
- TeamStore.updateUnreadCount(action.team_id, action.total_msg_count, action.channelMember);
- }
- break;
case ActionTypes.RECEIVED_POST:
if (action.post.type === PostTypes.JOIN_LEAVE || action.post.type === PostTypes.JOIN_CHANNEL || action.post.type === PostTypes.LEAVE_CHANNEL) {
return;