diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-08-02 17:09:53 -0400 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2017-08-02 17:09:53 -0400 |
commit | 345bb2236f1f34c2b1ddfec0024ea47c4b1b8950 (patch) | |
tree | f235066ee6b32ef1731a1d38765f8cb23615efa6 /webapp | |
parent | eee711145cb0b466dc8ccca886d1f67cd83cdfdc (diff) | |
download | chat-345bb2236f1f34c2b1ddfec0024ea47c4b1b8950.tar.gz chat-345bb2236f1f34c2b1ddfec0024ea47c4b1b8950.tar.bz2 chat-345bb2236f1f34c2b1ddfec0024ea47c4b1b8950.zip |
Fix teams being incorrectly marked unread across tabs (#7062)
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/stores/team_store.jsx | 5 |
1 files changed, 5 insertions, 0 deletions
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); |