Skip to content

Commit

Permalink
Display only direct contributors in the Articles list
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Parisot committed Mar 10, 2022
1 parent 455ca3b commit 63d66ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions front/src/components/Article.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ConnectedArticle = ({ article, applicationConfig, activeUser, sessionToken
const isArticleOwner = activeUser._id === article.owner._id
const acquintanceService = new AcquintanceService(activeUser._id, applicationConfig)

const contributors = [].concat(article.contributors, activeUser.permissions).filter(c => c.user._id !== article.owner._id)
const contributors = article.contributors.filter(c => c.user._id !== article.owner._id)

const fork = async () => {
try {
Expand Down Expand Up @@ -161,7 +161,7 @@ const ConnectedArticle = ({ article, applicationConfig, activeUser, sessionToken
))}
by <span className={styles.author}>{article.owner.displayName}</span>
{contributors.length > 0 && (<span className={styles.contributors}>
and shared with <span className={styles.author}>{contributors.map(c => c.user.displayName).join(', ')}</span>
, <span className={styles.author}>{contributors.map(c => c.user.displayName).join(', ')}</span>
</span>)}

<time dateTime={article.updatedAt} className={styles.momentsAgo}>
Expand Down

0 comments on commit 63d66ba

Please sign in to comment.