summaryrefslogtreecommitdiffstats
path: root/web/react/components/edit_channel_modal.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/components/edit_channel_modal.jsx')
-rw-r--r--web/react/components/edit_channel_modal.jsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/web/react/components/edit_channel_modal.jsx b/web/react/components/edit_channel_modal.jsx
index 0398dba93..a35a531b5 100644
--- a/web/react/components/edit_channel_modal.jsx
+++ b/web/react/components/edit_channel_modal.jsx
@@ -30,15 +30,19 @@ module.exports = React.createClass({
handleUserInput: function(e) {
this.setState({ description: e.target.value });
},
+ handleClose: function() {
+ this.setState({description: "", server_error: ""});
+ },
componentDidMount: function() {
var self = this;
$(this.refs.modal.getDOMNode()).on('show.bs.modal', function(e) {
var button = e.relatedTarget;
self.setState({ description: $(button).attr('data-desc'), title: $(button).attr('data-title'), channel_id: $(button).attr('data-channelid'), server_error: "" });
});
- $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function() {
- self.setState({description: ""});
- })
+ $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', this.handleClose)
+ },
+ componentWillUnmount: function() {
+ $(this.refs.modal.getDOMNode()).off('hidden.bs.modal', this.handleClose)
},
getInitialState: function() {
return { description: "", title: "", channel_id: "" };