From 345bb2236f1f34c2b1ddfec0024ea47c4b1b8950 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 2 Aug 2017 17:09:53 -0400 Subject: Fix teams being incorrectly marked unread across tabs (#7062) --- webapp/stores/team_store.jsx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'webapp') diff --git a/webapp/stores/team_store.jsx b/webapp/stores/team_store.jsx index 83a59a32e..1c38ba5e7 100644 --- a/webapp/stores/team_store.jsx +++ b/webapp/stores/team_store.jsx @@ -10,6 +10,7 @@ import Constants from 'utils/constants.jsx'; const NotificationPrefs = Constants.NotificationPrefs; import {getSiteURL} from 'utils/url.jsx'; +import {isSystemMessage, isFromWebhook} from 'utils/post_utils.jsx'; const ActionTypes = Constants.ActionTypes; const CHANGE_EVENT = 'change'; @@ -449,6 +450,10 @@ TeamStore.dispatchToken = AppDispatcher.register((payload) => { return; } + if (action.post.user_id === UserStore.getCurrentId() && !isSystemMessage(action.post) && !isFromWebhook(action.post)) { + return; + } + var id = action.websocketMessageProps ? action.websocketMessageProps.team_id : null; if (id && TeamStore.getCurrentId() !== id) { TeamStore.incrementMessages(id, action.post.channel_id); -- cgit v1.2.3-1-g7c22