Skip to content

Commit

Permalink
cleanup; update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeaty committed Feb 27, 2025
1 parent ac924d5 commit d9c2c4b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
3 changes: 0 additions & 3 deletions server/src/core/server/graph/resolvers/Comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,4 @@ export const Comment: GQLCommentTypeResolver<comment.Comment> = {
const seen = seenComments ? id in seenComments.comments : false;
return seen;
},
isHidden: async ({ rejectedAncestorIDs }, input, ctx) => {
return rejectedAncestorIDs && rejectedAncestorIDs.length > 0;
},
};
6 changes: 0 additions & 6 deletions server/src/core/server/graph/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4588,12 +4588,6 @@ type Comment @cacheControl(maxAge: 5) {
"""
embeddedAt: Time

"""
isHidden is whether a comment is visually hidden in the stream, for example, by
having a rejected ancestor
"""
isHidden: Boolean

"""
rejectedAncestorIDs are the commentIDs of all of a comment's ancestors that are rejected
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const calculateRelationships = async (
}

// Then we get a count of all published comment descendants that are NOT still hidden
// by any other hiddenAncestor
// by any other rejectedAncestor
let count = await retrieveCountOfPublishedAndNotHiddenRepliesForComment(
mongo,
input.tenant.id,
Expand All @@ -206,7 +206,7 @@ export const calculateRelationships = async (
);

// if the newly APPROVED comment is already hidden by a rejectedAncestor, then we need to add
// 1 to the published replies to rejected comments count, since it wasn't already counted in that
// 1 to the count, since it wasn't already counted in that
if (
input.after.rejectedAncestorIDs &&
input.after.rejectedAncestorIDs.length > 0
Expand Down

0 comments on commit d9c2c4b

Please sign in to comment.