summaryrefslogtreecommitdiffstats
path: root/webapp/actions/post_actions.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/actions/post_actions.jsx')
-rw-r--r--webapp/actions/post_actions.jsx18
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) {