summaryrefslogtreecommitdiffstats
path: root/web/react/components/msg_typing.jsx
diff options
context:
space:
mode:
authornickago <ngonella@calpoly.edu>2015-07-06 08:14:42 -0700
committernickago <ngonella@calpoly.edu>2015-07-06 08:14:42 -0700
commit0b71537ff0e117f6845fd9294fa9df34f483c6bb (patch)
treea9366bf08fc4c1f9baacafc7099ec31f4960f7aa /web/react/components/msg_typing.jsx
parentb819b492bf3c5d1f2353b086dbf7b70fd6a98869 (diff)
downloadchat-0b71537ff0e117f6845fd9294fa9df34f483c6bb.tar.gz
chat-0b71537ff0e117f6845fd9294fa9df34f483c6bb.tar.bz2
chat-0b71537ff0e117f6845fd9294fa9df34f483c6bb.zip
Typing notifier resets on channel change
Diffstat (limited to 'web/react/components/msg_typing.jsx')
-rw-r--r--web/react/components/msg_typing.jsx13
1 files changed, 9 insertions, 4 deletions
diff --git a/web/react/components/msg_typing.jsx b/web/react/components/msg_typing.jsx
index 9d3904757..3b97fb2ef 100644
--- a/web/react/components/msg_typing.jsx
+++ b/web/react/components/msg_typing.jsx
@@ -1,7 +1,7 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.
-
+var ChannelStore = require('../stores/channel_store.jsx');
var SocketStore = require('../stores/socket_store.jsx');
var UserStore = require('../stores/user_store.jsx');
@@ -9,12 +9,17 @@ module.exports = React.createClass({
timer: null,
lastTime: 0,
componentDidMount: function() {
- SocketStore.addChangeListener(this._onChange);
+ ChannelStore.addDiffChannelChangeListener(this._onChange);
+ SocketStore.addChangeListener(this._onSocketChange);
},
componentWillUnmount: function() {
- SocketStore.removeChangeListener(this._onChange);
+ ChannelStore.removeDiffCHannelChangeListener(this._onChange);
+ SocketStore.removeChangeListener(this._onSocketChange);
+ },
+ _onChange: function() {
+ this.setState({text:""})
},
- _onChange: function(msg) {
+ _onSocketChange: function(msg) {
if (msg.action == "typing" &&
this.props.channelId == msg.channel_id &&
this.props.parentId == msg.props.parent_id) {