Skip to content

Commit

Permalink
language
Browse files Browse the repository at this point in the history
  • Loading branch information
YukiOnishi1129 committed Apr 18, 2024
1 parent 181164c commit 9ec7b8d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
4 changes: 4 additions & 0 deletions web/client/src/features/articles/components/ArticleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export function ArticleList({
};
}, [hashMore]);

useEffect(() => {
setArticles(initialArticles);
}, [initialArticles]);

useEffect(() => {
if (offset > 1) {
loadMore(offset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,15 @@ const ArticleListContent = async ({
/>
</div>

{languageStatus === 1 && (
<ArticleList
user={user}
initialArticles={res.data.articles}
languageStatus={languageStatus}
keyword={keyword}
platformIdList={platformIdList}
tab={tab}
fetchArticles={fetchArticlesAPI}
/>
)}
{languageStatus === 2 && (
<ArticleList
user={user}
initialArticles={res.data.articles}
languageStatus={languageStatus}
keyword={keyword}
platformIdList={platformIdList}
tab={tab}
fetchArticles={fetchArticlesAPI}
/>
)}
<ArticleList
user={user}
initialArticles={res.data.articles}
languageStatus={languageStatus}
keyword={keyword}
platformIdList={platformIdList}
tab={tab}
fetchArticles={fetchArticlesAPI}
/>
</>
);
};

0 comments on commit 9ec7b8d

Please sign in to comment.