unregister hooks

This commit is contained in:
Belen Curcio
2017-04-12 09:33:24 -03:00
parent 83eb6492c2
commit 72c698231b
2 changed files with 21 additions and 8 deletions
@@ -7,7 +7,7 @@ class OffTopicCheckbox extends React.Component {
handleChange = (e) => {
if (e.target.checked) {
this.props.addCommentHooks({
this.props.registerHook({
postSubmit: {
addTag: (data) => {
const {comment} = data.createComment;
@@ -19,11 +19,7 @@ class OffTopicCheckbox extends React.Component {
}
})
} else {
this.props.addCommentHooks({
postSubmit: {
addTag: () => {}
}
})
this.props.unregisterHook('postSubmit', 'addTag');
}
}