diff options
author | Asaad Mahmood <Unknowngi@live.com> | 2015-10-19 22:59:01 +0500 |
---|---|---|
committer | Asaad Mahmood <Unknowngi@live.com> | 2015-10-19 22:59:01 +0500 |
commit | 5135986a3b13c0a4474dbbca683d89ffbc1dead5 (patch) | |
tree | 42e511c01a0e707356091fd4d09911eb18b8ca20 /web/react/components/msg_typing.jsx | |
parent | 2d42aefeafd2a0bea6419a6ef79c0c9b1fd313eb (diff) | |
parent | fd69910fab332642a7793e64064169e89eb0c3de (diff) | |
download | chat-5135986a3b13c0a4474dbbca683d89ffbc1dead5.tar.gz chat-5135986a3b13c0a4474dbbca683d89ffbc1dead5.tar.bz2 chat-5135986a3b13c0a4474dbbca683d89ffbc1dead5.zip |
Merge branch 'master' of https://github.com/mattermost/platform into ui-improvements
Diffstat (limited to 'web/react/components/msg_typing.jsx')
-rw-r--r-- | web/react/components/msg_typing.jsx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/web/react/components/msg_typing.jsx b/web/react/components/msg_typing.jsx index 569942390..1bd23c55c 100644 --- a/web/react/components/msg_typing.jsx +++ b/web/react/components/msg_typing.jsx @@ -1,8 +1,11 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -var SocketStore = require('../stores/socket_store.jsx'); -var UserStore = require('../stores/user_store.jsx'); +const SocketStore = require('../stores/socket_store.jsx'); +const UserStore = require('../stores/user_store.jsx'); + +const Constants = require('../utils/constants.jsx'); +const SocketEvents = Constants.SocketEvents; export default class MsgTyping extends React.Component { constructor(props) { @@ -33,9 +36,9 @@ export default class MsgTyping extends React.Component { } onChange(msg) { - if (msg.action === 'typing' && - this.props.channelId === msg.channel_id && - this.props.parentId === msg.props.parent_id) { + if (msg.action === SocketEvents.TYPING && + this.props.channelId === msg.channel_id && + this.props.parentId === msg.props.parent_id) { this.lastTime = new Date().getTime(); var username = 'Someone'; @@ -52,7 +55,7 @@ export default class MsgTyping extends React.Component { } }.bind(this), 3000); } - } else if (msg.action === 'posted' && msg.channel_id === this.props.channelId) { + } else if (msg.action === SocketEvents.POSTED && msg.channel_id === this.props.channelId) { this.setState({text: ''}); } } |