the pre-mod tab does not request action_summaries since there wouldn't be any

This commit is contained in:
Riley Davis
2017-04-20 14:33:49 -06:00
parent 1ec30854c2
commit 3dc2674f47
@@ -21,8 +21,13 @@ const lang = new I18n(translations);
const Comment = ({actions = [], comment, ...props}) => {
const links = linkify.getMatches(comment.body);
const linkText = links ? links.map(link => link.raw) : [];
const flagActionSummaries = getActionSummary('FlagActionSummary', comment);
const flagActions = comment.actions && comment.actions.filter(a => a.__typename === 'FlagAction');
let flagActionSummaries;
let flagActions;
if (comment.action_summaries) { // this might be missing if we're on the pre-mod tab
flagActionSummaries = getActionSummary('FlagActionSummary', comment);
flagActions = comment.actions && comment.actions.filter(a => a.__typename === 'FlagAction');
}
return (
<li tabIndex={props.index} className={`mdl-card ${props.selected ? 'mdl-shadow--8dp' : 'mdl-shadow--2dp'} ${styles.Comment} ${styles.listItem}`}>