diff --git a/plugins/talk-plugin-rich-text-pell/client/components/Editor.js b/plugins/talk-plugin-rich-text-pell/client/components/Editor.js index 29121d4b6..33b122f09 100644 --- a/plugins/talk-plugin-rich-text-pell/client/components/Editor.js +++ b/plugins/talk-plugin-rich-text-pell/client/components/Editor.js @@ -11,7 +11,7 @@ class Editor extends React.Component { handleRef = ref => (this.ref = ref); componentDidMount() { - const { onChange, actions, classNames } = this.props; + const { onChange, actions, classNames, isReply } = this.props; init({ element: this.ref, @@ -37,17 +37,19 @@ class Editor extends React.Component { }); // To edit comments and have the previous html comment - if (this.props.comment && this.props.comment.richTextBody) { + if (this.props.comment && this.props.comment.richTextBody && !isReply) { this.ref.content.innerHTML = this.props.comment.richTextBody; } - this.clearInputHook = this.props.registerHook( - 'postSubmit', - (res, handleBodyChange) => { - this.ref.content.innerHTML = ''; - handleBodyChange('', { richTextBody: '' }); - } - ); + if (this.props.registerHook) { + this.clearInputHook = this.props.registerHook( + 'postSubmit', + (res, handleBodyChange) => { + this.ref.content.innerHTML = ''; + handleBodyChange('', { richTextBody: '' }); + } + ); + } } componentWillUnmount() { diff --git a/plugins/talk-plugin-toxic-comments/client/components/CheckToxicityHook.js b/plugins/talk-plugin-toxic-comments/client/components/CheckToxicityHook.js index 528960310..4331e006b 100644 --- a/plugins/talk-plugin-toxic-comments/client/components/CheckToxicityHook.js +++ b/plugins/talk-plugin-toxic-comments/client/components/CheckToxicityHook.js @@ -49,6 +49,6 @@ export default class CheckToxicityHook extends React.Component { CheckToxicityHook.propTypes = { notify: PropTypes.func.isRequired, - registerHook: PropTypes.func.isRequired, - unregisterHook: PropTypes.func.isRequired, + registerHook: PropTypes.func, + unregisterHook: PropTypes.func, };