From 06f89cea302bc2d634044cbab6c8a5c5b369ff02 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 13 Feb 2017 15:19:41 -0500 Subject: Final fixes for moving unread handling to client (#5392) --- webapp/stores/channel_store.jsx | 5 +++++ webapp/stores/team_store.jsx | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'webapp/stores') diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx index ba6620750..aacc23305 100644 --- a/webapp/stores/channel_store.jsx +++ b/webapp/stores/channel_store.jsx @@ -10,6 +10,7 @@ import UserStore from 'stores/user_store.jsx'; var Utils; import {ActionTypes, Constants} from 'utils/constants.jsx'; const NotificationPrefs = Constants.NotificationPrefs; +const PostTypes = Constants.PostTypes; const CHANGE_EVENT = 'change'; const STATS_EVENT = 'stats'; @@ -500,6 +501,10 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => { break; case ActionTypes.RECEIVED_POST: + if (action.post.type === PostTypes.JOIN_LEAVE || action.post.type === PostTypes.JOIN_CHANNEL || action.post.type === PostTypes.LEAVE_CHANNEL) { + return; + } + var id = action.post.channel_id; var teamId = action.websocketMessageProps ? action.websocketMessageProps.team_id : null; diff --git a/webapp/stores/team_store.jsx b/webapp/stores/team_store.jsx index af17f7b6f..b0133e44c 100644 --- a/webapp/stores/team_store.jsx +++ b/webapp/stores/team_store.jsx @@ -8,6 +8,8 @@ import ChannelStore from 'stores/channel_store.jsx'; import Constants from 'utils/constants.jsx'; const NotificationPrefs = Constants.NotificationPrefs; +const PostTypes = Constants.PostTypes; + import {getSiteURL} from 'utils/url.jsx'; const ActionTypes = Constants.ActionTypes; @@ -395,6 +397,10 @@ TeamStore.dispatchToken = AppDispatcher.register((payload) => { } break; case ActionTypes.RECEIVED_POST: + if (action.post.type === PostTypes.JOIN_LEAVE || action.post.type === PostTypes.JOIN_CHANNEL || action.post.type === PostTypes.LEAVE_CHANNEL) { + return; + } + var id = action.websocketMessageProps ? action.websocketMessageProps.team_id : ''; if (TeamStore.getCurrentId() !== id && id.length > 0) { TeamStore.incrementMessages(id, action.post.channel_id); -- cgit v1.2.3-1-g7c22