Fix JS error on out of channel mentions and slash commands (#5395)

This commit is contained in:
Joram Wilander
2017-02-13 22:22:21 -05:00
committed by Corey Hulen
parent 62e20e98f9
commit 8da1c696d4

View File

@@ -401,8 +401,8 @@ TeamStore.dispatchToken = AppDispatcher.register((payload) => {
return;
}
var id = action.websocketMessageProps ? action.websocketMessageProps.team_id : '';
if (TeamStore.getCurrentId() !== id && id.length > 0) {
var id = action.websocketMessageProps ? action.websocketMessageProps.team_id : null;
if (id && TeamStore.getCurrentId() !== id) {
TeamStore.incrementMessages(id, action.post.channel_id);
TeamStore.incrementMentionsIfNeeded(id, action.websocketMessageProps);
TeamStore.emitChange();