mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
unregister hooks
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user