summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/react/components/msg_typing.jsx8
1 files changed, 8 insertions, 0 deletions
diff --git a/web/react/components/msg_typing.jsx b/web/react/components/msg_typing.jsx
index 9d3904757..a6953028f 100644
--- a/web/react/components/msg_typing.jsx
+++ b/web/react/components/msg_typing.jsx
@@ -11,6 +11,11 @@ module.exports = React.createClass({
componentDidMount: function() {
SocketStore.addChangeListener(this._onChange);
},
+ componentWillReceiveProps: function(newProps) {
+ if(this.props.channelId !== newProps.channelId) {
+ this.setState({text:""});
+ }
+ },
componentWillUnmount: function() {
SocketStore.removeChangeListener(this._onChange);
},
@@ -37,6 +42,9 @@ module.exports = React.createClass({
}, 3000);
}
}
+ else if (msg.action == "posted" && msg.channel_id === this.props.channelId) {
+ this.setState({text:""})
+ }
},
getInitialState: function() {
return { text: "" };