Fix new admin comments not showing up in premod

This commit is contained in:
Chi Vinh Le
2017-12-18 16:41:05 +01:00
parent 98ef60a48e
commit 5b8f335b2a
2 changed files with 7 additions and 1 deletions
@@ -193,7 +193,12 @@ export default {
},
updateQueries: {
CoralEmbedStream_Embed: (prev, {mutationResult: {data: {createComment: {comment}}}}) => {
if (prev.asset.settings.moderation === 'PRE' || comment.status === 'PREMOD' || comment.status === 'REJECTED' || comment.status === 'SYSTEM_WITHHELD') {
if (
prev.me.roles.indexOf('ADMIN') === -1 && prev.asset.settings.moderation === 'PRE' ||
comment.status === 'PREMOD' ||
comment.status === 'REJECTED' ||
comment.status === 'SYSTEM_WITHHELD'
) {
return prev;
}
return insertCommentIntoEmbedQuery(prev, comment);
@@ -285,6 +285,7 @@ const fragments = {
ignoredUsers {
id
}
roles
}
settings {
organizationName