Don't wrongly highlight '[deleted]' as post author

This commit is contained in:
Christopher Gurnee 2022-02-07 20:21:44 -05:00
parent a8b32127d1
commit ec51dc05cc
2 changed files with 2 additions and 2 deletions

View file

@ -46,7 +46,7 @@ const Comment = (props) => {
<span className='space' />
<a
href={props.author !== '[deleted]' ? `https://www.reddit.com/user/${props.author}` : undefined}
className={props.author == props.postAuthor ? 'author comment-author comment-poster' : 'author comment-author'}
className={props.author === props.postAuthor ? 'author comment-author comment-poster' : 'author comment-author'}
>
{props.author}
{props.deleted && ' (deleted by user)'}

View file

@ -192,7 +192,7 @@ class Thread extends React.Component {
comments={this.state.pushshiftCommentLookup}
removed={this.state.removed}
deleted={this.state.deleted}
postAuthor={author}
postAuthor={isDeleted(author) ? null : author}
/>
</React.Fragment>
}