@@ -655,10 +655,6 @@ export class CommentService {
655655 type ?: CollectionRefTypes ,
656656 ) {
657657 const reader = await this . assignReaderToComment ( )
658- const isLoggedInComment =
659- ! ! reader ||
660- RequestContext . hasReaderIdentity ( ) ||
661- RequestContext . hasAdminAccess ( )
662658 if ( reader ) {
663659 this . stripReaderIdentitySnapshot ( doc )
664660 this . assignAuthProviderToComment ( doc )
@@ -693,7 +689,9 @@ export class CommentService {
693689
694690 const comment = ( await this . commentModel . create ( {
695691 ...doc ,
696- state : isLoggedInComment ? CommentState . Read : CommentState . Unread ,
692+ state : RequestContext . hasAdminAccess ( )
693+ ? CommentState . Read
694+ : CommentState . Unread ,
697695 ref : new Types . ObjectId ( id ) ,
698696 parentCommentId : null ,
699697 replyCount : 0 ,
@@ -747,10 +745,6 @@ export class CommentService {
747745 }
748746
749747 const reader = await this . assignReaderToComment ( )
750- const isLoggedInComment =
751- ! ! reader ||
752- RequestContext . hasReaderIdentity ( ) ||
753- RequestContext . hasAdminAccess ( )
754748 if ( reader ) {
755749 this . stripReaderIdentitySnapshot ( doc )
756750 this . assignAuthProviderToComment ( doc )
@@ -761,7 +755,9 @@ export class CommentService {
761755 ...doc ,
762756 state :
763757 doc . state ??
764- ( isLoggedInComment ? CommentState . Read : CommentState . Unread ) ,
758+ ( RequestContext . hasAdminAccess ( )
759+ ? CommentState . Read
760+ : CommentState . Unread ) ,
765761 ref : this . toObjectId ( parent . ref as any ) ,
766762 refType : parent . refType ,
767763 parentCommentId : parent . _id ,
0 commit comments