diff options
author | enahum <nahumhbl@gmail.com> | 2016-12-19 10:05:46 -0300 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-12-19 08:05:46 -0500 |
commit | 999d1553e1ce45adf58f6082b160bc1147dc592b (patch) | |
tree | 369a9b7f46dd44d136a79a050469429169433cec /webapp/actions/post_actions.jsx | |
parent | 3ce2ce9dc882ed962dc3ce7550bdb07963f376b6 (diff) | |
download | chat-999d1553e1ce45adf58f6082b160bc1147dc592b.tar.gz chat-999d1553e1ce45adf58f6082b160bc1147dc592b.tar.bz2 chat-999d1553e1ce45adf58f6082b160bc1147dc592b.zip |
PLT-4167 Team Sidebar (#4569)
* PLT-4167 Team Sidebar
* Address feedback from PM
* change route from my_members to members
* bug fixes
* Updating styles for teams sidebar (#4681)
* Added PM changes
* Fix corner cases
* Addressing feedback
* use two different endpoints
* Bug fixes
* Rename model and client functions, using preferences to store last team and channel viewed
* Fix mobile notification count and closing the team sidebar
* unit test, fixed bad merge and retrieve from cached when available
* bug fixes
* use id for last channel in preferences, query optimization
* Updating multi team css (#4830)
Diffstat (limited to 'webapp/actions/post_actions.jsx')
-rw-r--r-- | webapp/actions/post_actions.jsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/webapp/actions/post_actions.jsx b/webapp/actions/post_actions.jsx index 736aef033..d1e69cda7 100644 --- a/webapp/actions/post_actions.jsx +++ b/webapp/actions/post_actions.jsx @@ -18,23 +18,30 @@ const ActionTypes = Constants.ActionTypes; const Preferences = Constants.Preferences; export function handleNewPost(post, msg) { + const teamId = TeamStore.getCurrentId(); + if (ChannelStore.getCurrentId() === post.channel_id) { if (window.isActive) { AsyncClient.updateLastViewedAt(null, false); } else { AsyncClient.getChannel(post.channel_id); } - } else if (msg && (TeamStore.getCurrentId() === msg.data.team_id || msg.data.channel_type === Constants.DM_CHANNEL)) { + } else if (msg && (teamId === msg.data.team_id || msg.data.channel_type === Constants.DM_CHANNEL)) { if (Client.teamId) { AsyncClient.getChannel(post.channel_id); } } - var websocketMessageProps = null; + let websocketMessageProps = null; if (msg) { websocketMessageProps = msg.data; } + const myTeams = TeamStore.getMyTeamMembers(); + if (msg.data.team_id !== teamId && myTeams.filter((m) => m.team_id === msg.data.team_id).length) { + AsyncClient.getMyTeamsUnread(teamId); + } + if (post.root_id && PostStore.getPost(post.channel_id, post.root_id) == null) { Client.getPost( post.channel_id, |