Increase performance when receiving messages (#5375)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
fac85b676e
Коммит
ff741740ee
@@ -753,16 +753,6 @@ func autocompleteChannels(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
func viewChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
func viewChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||||
view := model.ChannelViewFromJson(r.Body)
|
view := model.ChannelViewFromJson(r.Body)
|
||||||
|
|
||||||
if err := app.SetActiveChannel(c.Session.UserId, view.ChannelId); err != nil {
|
|
||||||
c.Err = err
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(view.ChannelId) == 0 {
|
|
||||||
ReturnStatusOK(w)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := app.ViewChannel(view, c.TeamId, c.Session.UserId, !c.Session.IsMobileApp()); err != nil {
|
if err := app.ViewChannel(view, c.TeamId, c.Session.UserId, !c.Session.IsMobileApp()); err != nil {
|
||||||
c.Err = err
|
c.Err = err
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -101,11 +101,6 @@ func updateLastViewedAt(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
app.Srv.Store.Preference().Save(&model.Preferences{teamPref, chanPref})
|
app.Srv.Store.Preference().Save(&model.Preferences{teamPref, chanPref})
|
||||||
|
|
||||||
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, c.TeamId, "", c.Session.UserId, nil)
|
|
||||||
message.Add("channel_id", id)
|
|
||||||
|
|
||||||
go app.Publish(message)
|
|
||||||
|
|
||||||
result := make(map[string]string)
|
result := make(map[string]string)
|
||||||
result["id"] = id
|
result["id"] = id
|
||||||
w.Write([]byte(model.MapToJson(result)))
|
w.Write([]byte(model.MapToJson(result)))
|
||||||
@@ -136,11 +131,6 @@ func setLastViewedAt(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
app.Srv.Store.Preference().Save(&model.Preferences{teamPref, chanPref})
|
app.Srv.Store.Preference().Save(&model.Preferences{teamPref, chanPref})
|
||||||
|
|
||||||
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, c.TeamId, "", c.Session.UserId, nil)
|
|
||||||
message.Add("channel_id", id)
|
|
||||||
|
|
||||||
go app.Publish(message)
|
|
||||||
|
|
||||||
result := make(map[string]string)
|
result := make(map[string]string)
|
||||||
result["id"] = id
|
result["id"] = id
|
||||||
w.Write([]byte(model.MapToJson(result)))
|
w.Write([]byte(model.MapToJson(result)))
|
||||||
|
|||||||
@@ -844,7 +844,15 @@ func SearchChannelsUserNotIn(teamId string, userId string, term string) (*model.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ViewChannel(view *model.ChannelView, teamId string, userId string, clearPushNotifications bool) *model.AppError {
|
func ViewChannel(view *model.ChannelView, teamId string, userId string, clearPushNotifications bool) *model.AppError {
|
||||||
channelIds := []string{view.ChannelId}
|
if err := SetActiveChannel(userId, view.ChannelId); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
channelIds := []string{}
|
||||||
|
|
||||||
|
if len(view.ChannelId) > 0 {
|
||||||
|
channelIds = append(channelIds, view.ChannelId)
|
||||||
|
}
|
||||||
|
|
||||||
var pchan store.StoreChannel
|
var pchan store.StoreChannel
|
||||||
if len(view.PrevChannelId) > 0 {
|
if len(view.PrevChannelId) > 0 {
|
||||||
@@ -855,6 +863,10 @@ func ViewChannel(view *model.ChannelView, teamId string, userId string, clearPus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(channelIds) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
uchan := Srv.Store.Channel().UpdateLastViewedAt(channelIds, userId)
|
uchan := Srv.Store.Channel().UpdateLastViewedAt(channelIds, userId)
|
||||||
|
|
||||||
if pchan != nil {
|
if pchan != nil {
|
||||||
@@ -871,10 +883,6 @@ func ViewChannel(view *model.ChannelView, teamId string, userId string, clearPus
|
|||||||
return result.Err
|
return result.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, teamId, "", userId, nil)
|
|
||||||
message.Add("channel_id", view.ChannelId)
|
|
||||||
go Publish(message)
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ const (
|
|||||||
WEBSOCKET_EVENT_POST_EDITED = "post_edited"
|
WEBSOCKET_EVENT_POST_EDITED = "post_edited"
|
||||||
WEBSOCKET_EVENT_POST_DELETED = "post_deleted"
|
WEBSOCKET_EVENT_POST_DELETED = "post_deleted"
|
||||||
WEBSOCKET_EVENT_CHANNEL_DELETED = "channel_deleted"
|
WEBSOCKET_EVENT_CHANNEL_DELETED = "channel_deleted"
|
||||||
WEBSOCKET_EVENT_CHANNEL_VIEWED = "channel_viewed"
|
|
||||||
WEBSOCKET_EVENT_DIRECT_ADDED = "direct_added"
|
WEBSOCKET_EVENT_DIRECT_ADDED = "direct_added"
|
||||||
WEBSOCKET_EVENT_NEW_USER = "new_user"
|
WEBSOCKET_EVENT_NEW_USER = "new_user"
|
||||||
WEBSOCKET_EVENT_LEAVE_TEAM = "leave_team"
|
WEBSOCKET_EVENT_LEAVE_TEAM = "leave_team"
|
||||||
|
|||||||
@@ -47,16 +47,17 @@ export function emitChannelClickEvent(channel) {
|
|||||||
function switchToChannel(chan) {
|
function switchToChannel(chan) {
|
||||||
const channelMember = ChannelStore.getMyMember(chan.id);
|
const channelMember = ChannelStore.getMyMember(chan.id);
|
||||||
const getMyChannelMembersPromise = AsyncClient.getChannelMember(chan.id, UserStore.getCurrentId());
|
const getMyChannelMembersPromise = AsyncClient.getChannelMember(chan.id, UserStore.getCurrentId());
|
||||||
|
const oldChannelId = ChannelStore.getCurrentId();
|
||||||
|
|
||||||
getMyChannelMembersPromise.then(() => {
|
getMyChannelMembersPromise.then(() => {
|
||||||
AsyncClient.getChannelStats(chan.id, true);
|
AsyncClient.getChannelStats(chan.id, true);
|
||||||
AsyncClient.viewChannel(chan.id, ChannelStore.getCurrentId());
|
AsyncClient.viewChannel(chan.id, oldChannelId);
|
||||||
loadPosts(chan.id);
|
loadPosts(chan.id);
|
||||||
trackPage();
|
trackPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Mark previous and next channel as read
|
// Mark previous and next channel as read
|
||||||
ChannelStore.resetCounts(ChannelStore.getCurrentId());
|
ChannelStore.resetCounts(oldChannelId);
|
||||||
ChannelStore.resetCounts(chan.id);
|
ChannelStore.resetCounts(chan.id);
|
||||||
|
|
||||||
BrowserStore.setGlobalItem(chan.team_id, chan.id);
|
BrowserStore.setGlobalItem(chan.team_id, chan.id);
|
||||||
@@ -68,7 +69,7 @@ export function emitChannelClickEvent(channel) {
|
|||||||
team_id: chan.team_id,
|
team_id: chan.team_id,
|
||||||
total_msg_count: chan.total_msg_count,
|
total_msg_count: chan.total_msg_count,
|
||||||
channelMember,
|
channelMember,
|
||||||
prev: ChannelStore.getCurrentId()
|
prev: oldChannelId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
|
|||||||
|
|
||||||
import ChannelStore from 'stores/channel_store.jsx';
|
import ChannelStore from 'stores/channel_store.jsx';
|
||||||
import PostStore from 'stores/post_store.jsx';
|
import PostStore from 'stores/post_store.jsx';
|
||||||
import TeamStore from 'stores/team_store.jsx';
|
|
||||||
import UserStore from 'stores/user_store.jsx';
|
import UserStore from 'stores/user_store.jsx';
|
||||||
|
|
||||||
import {loadStatusesForChannel} from 'actions/status_actions.jsx';
|
import {loadStatusesForChannel} from 'actions/status_actions.jsx';
|
||||||
@@ -18,30 +17,11 @@ const ActionTypes = Constants.ActionTypes;
|
|||||||
const Preferences = Constants.Preferences;
|
const Preferences = Constants.Preferences;
|
||||||
|
|
||||||
export function handleNewPost(post, msg) {
|
export function handleNewPost(post, msg) {
|
||||||
const teamId = TeamStore.getCurrentId();
|
|
||||||
|
|
||||||
if (ChannelStore.getCurrentId() === post.channel_id) {
|
|
||||||
if (window.isActive) {
|
|
||||||
AsyncClient.viewChannel();
|
|
||||||
} else {
|
|
||||||
AsyncClient.getChannel(post.channel_id);
|
|
||||||
}
|
|
||||||
} else if (msg && (teamId === msg.data.team_id || msg.data.channel_type === Constants.DM_CHANNEL)) {
|
|
||||||
if (Client.teamId) {
|
|
||||||
AsyncClient.getChannel(post.channel_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let websocketMessageProps = null;
|
let websocketMessageProps = null;
|
||||||
if (msg) {
|
if (msg) {
|
||||||
websocketMessageProps = msg.data;
|
websocketMessageProps = msg.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const myTeams = TeamStore.getMyTeamMembers();
|
|
||||||
if (msg.data.team_id !== teamId && myTeams.filter((m) => m.team_id === msg.data.team_id).length) {
|
|
||||||
AsyncClient.getMyTeamsUnread(teamId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (post.root_id && PostStore.getPost(post.channel_id, post.root_id) == null) {
|
if (post.root_id && PostStore.getPost(post.channel_id, post.root_id) == null) {
|
||||||
Client.getPost(
|
Client.getPost(
|
||||||
post.channel_id,
|
post.channel_id,
|
||||||
|
|||||||
@@ -145,3 +145,8 @@ export function inviteMembers(data, success, error) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function switchTeams(url) {
|
||||||
|
AsyncClient.viewChannel();
|
||||||
|
browserHistory.push(url);
|
||||||
|
}
|
||||||
|
|||||||
@@ -137,10 +137,6 @@ function handleEvent(msg) {
|
|||||||
handleUserUpdatedEvent(msg);
|
handleUserUpdatedEvent(msg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SocketEvents.CHANNEL_VIEWED:
|
|
||||||
handleChannelViewedEvent(msg);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SocketEvents.CHANNEL_DELETED:
|
case SocketEvents.CHANNEL_DELETED:
|
||||||
handleChannelDeletedEvent(msg);
|
handleChannelDeletedEvent(msg);
|
||||||
break;
|
break;
|
||||||
@@ -282,15 +278,6 @@ function handleUserUpdatedEvent(msg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleChannelViewedEvent(msg) {
|
|
||||||
// Useful for when multiple devices have the app open to different channels
|
|
||||||
if (TeamStore.getCurrentId() === msg.broadcast.team_id &&
|
|
||||||
ChannelStore.getCurrentId() !== msg.data.channel_id &&
|
|
||||||
UserStore.getCurrentId() === msg.broadcast.user_id) {
|
|
||||||
AsyncClient.getChannel(msg.data.channel_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleChannelDeletedEvent(msg) {
|
function handleChannelDeletedEvent(msg) {
|
||||||
if (ChannelStore.getCurrentId() === msg.data.channel_id) {
|
if (ChannelStore.getCurrentId() === msg.data.channel_id) {
|
||||||
const teamUrl = TeamStore.getCurrentTeamRelativeUrl();
|
const teamUrl = TeamStore.getCurrentTeamRelativeUrl();
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ import SelectTeamModal from 'components/admin_console/select_team_modal.jsx';
|
|||||||
import iNoBounce from 'inobounce';
|
import iNoBounce from 'inobounce';
|
||||||
import * as UserAgent from 'utils/user_agent.jsx';
|
import * as UserAgent from 'utils/user_agent.jsx';
|
||||||
|
|
||||||
|
const UNREAD_CHECK_TIME_MILLISECONDS = 10000;
|
||||||
|
|
||||||
export default class NeedsTeam extends React.Component {
|
export default class NeedsTeam extends React.Component {
|
||||||
constructor(params) {
|
constructor(params) {
|
||||||
super(params);
|
super(params);
|
||||||
@@ -49,6 +51,8 @@ export default class NeedsTeam extends React.Component {
|
|||||||
this.onTeamChanged = this.onTeamChanged.bind(this);
|
this.onTeamChanged = this.onTeamChanged.bind(this);
|
||||||
this.onPreferencesChanged = this.onPreferencesChanged.bind(this);
|
this.onPreferencesChanged = this.onPreferencesChanged.bind(this);
|
||||||
|
|
||||||
|
this.blurTime = new Date().getTime();
|
||||||
|
|
||||||
const team = TeamStore.getCurrent();
|
const team = TeamStore.getCurrent();
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
@@ -97,11 +101,16 @@ export default class NeedsTeam extends React.Component {
|
|||||||
AsyncClient.viewChannel();
|
AsyncClient.viewChannel();
|
||||||
ChannelStore.resetCounts(ChannelStore.getCurrentId());
|
ChannelStore.resetCounts(ChannelStore.getCurrentId());
|
||||||
ChannelStore.emitChange();
|
ChannelStore.emitChange();
|
||||||
|
|
||||||
window.isActive = true;
|
window.isActive = true;
|
||||||
|
if (new Date().getTime() - this.blurTime > UNREAD_CHECK_TIME_MILLISECONDS) {
|
||||||
|
AsyncClient.getMyChannelMembers();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).on('blur', () => {
|
$(window).on('blur', () => {
|
||||||
window.isActive = false;
|
window.isActive = false;
|
||||||
|
this.blurTime = new Date().getTime();
|
||||||
if (UserStore.getCurrentUser()) {
|
if (UserStore.getCurrentUser()) {
|
||||||
AsyncClient.viewChannel('');
|
AsyncClient.viewChannel('');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export default class PostViewCache extends React.Component {
|
|||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
if (UserStore.getCurrentUser()) {
|
if (UserStore.getCurrentUser()) {
|
||||||
AsyncClient.viewChannel('');
|
AsyncClient.viewChannel('', this.state.currentChannelId || '');
|
||||||
}
|
}
|
||||||
ChannelStore.removeChangeListener(this.onChannelChange);
|
ChannelStore.removeChangeListener(this.onChannelChange);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
|
|
||||||
|
import {switchTeams} from 'actions/team_actions.jsx';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Link} from 'react-router/es6';
|
import {Link} from 'react-router/es6';
|
||||||
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
|
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
|
||||||
@@ -11,9 +13,15 @@ export default class TeamButton extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
|
this.handleSwitch = this.handleSwitch.bind(this);
|
||||||
this.handleDisabled = this.handleDisabled.bind(this);
|
this.handleDisabled = this.handleDisabled.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleSwitch(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
switchTeams(this.props.url);
|
||||||
|
}
|
||||||
|
|
||||||
handleDisabled(e) {
|
handleDisabled(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
@@ -22,7 +30,7 @@ export default class TeamButton extends React.Component {
|
|||||||
let teamClass = this.props.active ? 'active' : '';
|
let teamClass = this.props.active ? 'active' : '';
|
||||||
const btnClass = this.props.btnClass;
|
const btnClass = this.props.btnClass;
|
||||||
const disabled = this.props.disabled ? 'team-disabled' : '';
|
const disabled = this.props.disabled ? 'team-disabled' : '';
|
||||||
const handleClick = (this.props.active || this.props.disabled) ? this.handleDisabled : null;
|
const handleClick = (this.props.active || this.props.disabled) ? this.handleDisabled : this.handleSwitch;
|
||||||
let badge;
|
let badge;
|
||||||
|
|
||||||
if (!teamClass) {
|
if (!teamClass) {
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ import PDFJS from 'pdfjs-dist';
|
|||||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||||
import * as Websockets from 'actions/websocket_actions.jsx';
|
import * as Websockets from 'actions/websocket_actions.jsx';
|
||||||
import BrowserStore from 'stores/browser_store.jsx';
|
import BrowserStore from 'stores/browser_store.jsx';
|
||||||
|
import ChannelStore from 'stores/channel_store.jsx';
|
||||||
import * as I18n from 'i18n/i18n.jsx';
|
import * as I18n from 'i18n/i18n.jsx';
|
||||||
|
import * as AsyncClient from 'utils/async_client.jsx';
|
||||||
|
|
||||||
// Import our styles
|
// Import our styles
|
||||||
import 'bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css';
|
import 'bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css';
|
||||||
@@ -58,6 +60,7 @@ function preRenderSetup(callwhendone) {
|
|||||||
$(window).on('beforeunload',
|
$(window).on('beforeunload',
|
||||||
() => {
|
() => {
|
||||||
BrowserStore.setLastServerVersion('');
|
BrowserStore.setLastServerVersion('');
|
||||||
|
AsyncClient.viewChannel('', ChannelStore.getCurrentId() || '');
|
||||||
Websockets.close();
|
Websockets.close();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -392,6 +392,31 @@ class ChannelStoreClass extends EventEmitter {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
incrementMessages(id) {
|
||||||
|
if (!this.unreadCounts[id]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.unreadCounts[id].msgs++;
|
||||||
|
this.get(id).total_msg_count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
incrementMentionsIfNeeded(id, msgProps) {
|
||||||
|
let mentions = [];
|
||||||
|
if (msgProps && msgProps.mentions) {
|
||||||
|
mentions = JSON.parse(msgProps.mentions);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.unreadCounts[id]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mentions.indexOf(UserStore.getCurrentId()) !== -1) {
|
||||||
|
this.unreadCounts[id].mentions++;
|
||||||
|
this.getMyMember(id).mention_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var ChannelStore = new ChannelStoreClass();
|
var ChannelStore = new ChannelStoreClass();
|
||||||
@@ -469,6 +494,18 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => {
|
|||||||
ChannelStore.emitStatsChange();
|
ChannelStore.emitStatsChange();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ActionTypes.RECEIVED_POST:
|
||||||
|
var id = action.post.channel_id;
|
||||||
|
var teamId = action.websocketMessageProps ? action.websocketMessageProps.team_id : '';
|
||||||
|
|
||||||
|
// Current team and not current channel or the window is inactive
|
||||||
|
if (TeamStore.getCurrentId() === teamId && (ChannelStore.getCurrentId() !== id || !window.isActive)) {
|
||||||
|
ChannelStore.incrementMessages(id);
|
||||||
|
ChannelStore.incrementMentionsIfNeeded(id, action.websocketMessageProps);
|
||||||
|
ChannelStore.emitChange();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,6 +316,23 @@ class TeamStoreClass extends EventEmitter {
|
|||||||
member.mention_count -= channelMember.mention_count;
|
member.mention_count -= channelMember.mention_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
incrementMessages(id) {
|
||||||
|
const member = this.my_team_members.filter((m) => m.team_id === id)[0];
|
||||||
|
member.msg_count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
incrementMentionsIfNeeded(id, msgProps) {
|
||||||
|
let mentions = [];
|
||||||
|
if (msgProps && msgProps.mentions) {
|
||||||
|
mentions = JSON.parse(msgProps.mentions);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mentions.indexOf(UserStore.getCurrentId()) !== -1) {
|
||||||
|
const member = this.my_team_members.filter((m) => m.team_id === id)[0];
|
||||||
|
member.mention_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var TeamStore = new TeamStoreClass();
|
var TeamStore = new TeamStoreClass();
|
||||||
@@ -370,6 +387,14 @@ TeamStore.dispatchToken = AppDispatcher.register((payload) => {
|
|||||||
TeamStore.emitUnreadChange();
|
TeamStore.emitUnreadChange();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ActionTypes.RECEIVED_POST:
|
||||||
|
var id = action.websocketMessageProps ? action.websocketMessageProps.team_id : '';
|
||||||
|
if (TeamStore.getCurrentId() !== id && id.length > 0) {
|
||||||
|
TeamStore.incrementMessages(id);
|
||||||
|
TeamStore.incrementMentionsIfNeeded(id, action.websocketMessageProps);
|
||||||
|
TeamStore.emitChange();
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user