Return all actions in CreateCommentResponse

This commit is contained in:
Chi Vinh Le
2017-09-20 04:17:15 +07:00
parent 5f7c4f82e7
commit 42954fb84a
5 changed files with 20 additions and 18 deletions
@@ -23,8 +23,8 @@ export default class CheckToxicityHook extends React.Component {
});
this.toxicityPostHook = this.props.registerHook('postSubmit', (result) => {
const flags = result.createComment.flags;
if (flags && flags.some(({reason}) => reason === 'TOXIC_COMMENT')) {
const actions = result.createComment.actions;
if (actions && actions.some(({__typename, reason}) => __typename === 'FlagAction' && reason === 'TOXIC_COMMENT')) {
this.props.notify('error', t('talk-plugin-toxic-comments.still_toxic'));
}