Skip to content

Commit

Permalink
fix(home): remove duplicate article in home page (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
120EE0692 authored Jul 19, 2023
1 parent 6506d43 commit 8196cfa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions client/src/screens/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ function Home({ issues, squiggles, witsdom, photostory, youtubeLinks }) {
const articles = [].concat(
...issues.map((issue) => {
return issue.articles.filter((article) => {
article !== null &&
return (
article !== null &&
!featuredArticles.some(
(featuredArticle) => featuredArticle.id !== article.id,
);
return article;
(featuredArticle) => featuredArticle.id === article.id,
)
);
});
}),
);
Expand Down Expand Up @@ -85,6 +86,7 @@ function Home({ issues, squiggles, witsdom, photostory, youtubeLinks }) {
.slice(2)
.map((index) => (
<ArticleCardStack
key={index}
articleList={articles.slice(
!tabletMatches ? 3 * index : 4 * index,
!tabletMatches ? 3 * (index + 1) : 4 * (index + 1),
Expand Down

0 comments on commit 8196cfa

Please sign in to comment.