actually, we want to have the action_summaries on all requests, since a plugin could potentially pre-flag a pre-mod comment

This commit is contained in:
Riley Davis
2017-04-20 14:37:48 -06:00
parent 3dc2674f47
commit 8708fcf2cd
3 changed files with 8 additions and 13 deletions
@@ -21,13 +21,8 @@ const lang = new I18n(translations);
const Comment = ({actions = [], comment, ...props}) => {
const links = linkify.getMatches(comment.body);
const linkText = links ? links.map(link => link.raw) : [];
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');
}
const flagActionSummaries = getActionSummary('FlagActionSummary', comment);
const 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}`}>
@@ -12,6 +12,12 @@ fragment commentView on Comment {
id
title
}
action_summaries {
count
... on FlagActionSummary {
reason
}
}
actions {
... on FlagAction {
reason
@@ -15,12 +15,6 @@ query ModQueue ($asset_id: ID, $sort: SORT_ORDER) {
sort: $sort
}) {
...commentView
action_summaries {
count
... on FlagActionSummary {
reason
}
}
}
rejected: comments(query: {
statuses: [REJECTED],