Changed FlagButton to use getErrorMessages util for failed flagging instead of custom messages

This commit is contained in:
PepeFranco
2017-10-10 12:55:32 -05:00
parent cecf2f4606
commit cf59bb213c
4 changed files with 4 additions and 8 deletions
@@ -8,6 +8,8 @@ import ClickOutside from 'coral-framework/components/ClickOutside';
import cn from 'classnames';
import styles from './styles.css';
import {getErrorMessages} from 'coral-framework/utils';
const name = 'talk-plugin-flags';
export default class FlagButton extends Component {
@@ -99,7 +101,7 @@ export default class FlagButton extends Component {
}
})
.catch((err) => {
this.props.notify('error', t('error.COMMENT_FLAG_FAILED'));
this.props.notify('error', getErrorMessages(err));
console.error(err);
});
} else {
@@ -110,7 +112,7 @@ export default class FlagButton extends Component {
}
})
.catch((err) => {
this.props.notify('error', t('error.USER_FLAG_FAILED'));
this.props.notify('error', getErrorMessages(err));
console.error(err);
});
}