diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-04-07 14:21:31 -0400 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-04-07 19:21:31 +0100 |
commit | 86fbd496af8ff646bcff8484ad1733101333e8c6 (patch) | |
tree | 894e300dd9555fd3a2313f1c4f2ec628cd3edc07 /webapp/actions/post_actions.jsx | |
parent | 9318ffcdf3caf77d66e0b9fc7967d9de9ea99b4b (diff) | |
download | chat-86fbd496af8ff646bcff8484ad1733101333e8c6.tar.gz chat-86fbd496af8ff646bcff8484ad1733101333e8c6.tar.bz2 chat-86fbd496af8ff646bcff8484ad1733101333e8c6.zip |
Check if we need to add DM/GM to sidebar regardless of post sender (#6009)
Diffstat (limited to 'webapp/actions/post_actions.jsx')
-rw-r--r-- | webapp/actions/post_actions.jsx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/webapp/actions/post_actions.jsx b/webapp/actions/post_actions.jsx index 015d93d0f..3af99f9fa 100644 --- a/webapp/actions/post_actions.jsx +++ b/webapp/actions/post_actions.jsx @@ -20,19 +20,11 @@ const ActionTypes = Constants.ActionTypes; const Preferences = Constants.Preferences; export function handleNewPost(post, msg) { - let websocketMessageProps = null; + let websocketMessageProps = {}; if (msg) { websocketMessageProps = msg.data; } - if (msg && msg.data) { - if (msg.data.channel_type === Constants.DM_CHANNEL) { - loadNewDMIfNeeded(post.user_id); - } else if (msg.data.channel_type === Constants.GM_CHANNEL) { - loadNewGMIfNeeded(post.channel_id, post.user_id); - } - } - if (ChannelStore.getMyMember(post.channel_id)) { completePostReceive(post, websocketMessageProps); } else { @@ -43,6 +35,14 @@ export function handleNewPost(post, msg) { AsyncClient.getChannelMember(post.channel_id, UserStore.getCurrentId()).then(() => completePostReceive(post, websocketMessageProps)); } + + if (msg && msg.data) { + if (msg.data.channel_type === Constants.DM_CHANNEL) { + loadNewDMIfNeeded(post.channel_id); + } else if (msg.data.channel_type === Constants.GM_CHANNEL) { + loadNewGMIfNeeded(post.channel_id); + } + } } function completePostReceive(post, websocketMessageProps) { |