Skip to content

Commit

Permalink
Merge pull request #242 from epigram5-9/merge/FE-27
Browse files Browse the repository at this point in the history
FE-27 🔀 브랜치 최신화
  • Loading branch information
jangmoonwon authored Aug 9, 2024
2 parents 4a3a6fc + 300a09f commit 5d092ea
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/main/RecentComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function RecentComments() {

useEffect(() => {
if (data) {
setComments((prevComments) => [...prevComments, ...data.list]);
setComments((prevComments) => [...prevComments.filter((comment) => !data.list.some((newComment) => newComment.id === comment.id)), ...data.list]);
if (data.list.length > 0) {
setCursor(data.list[data.list.length - 1].id);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/RecentEpigram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function RecentEpigrams() {

useEffect(() => {
if (data) {
setEpigrams((prevEpigrams) => [...prevEpigrams, ...data.list]);
setEpigrams((prevEpigrams) => [...prevEpigrams.filter((epigram) => !data.list.some((newEpigram) => newEpigram.id === epigram.id)), ...data.list]);
if (data.list.length > 0) {
setCursor(data.list[data.list.length - 1].id);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pageLayout/Feed/EpigramFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function EpigramFeed() {

useEffect(() => {
if (data) {
setEpigrams((prevEpigrams) => [...prevEpigrams, ...data.list]);
setEpigrams((prevEpigrams) => [...prevEpigrams, ...data.list.filter((epigram) => !new Set(prevEpigrams.map((e) => e.id)).has(epigram.id))]);
if (data.list.length > 0) {
setCursor(data.list[data.list.length - 1].id);
}
Expand Down

0 comments on commit 5d092ea

Please sign in to comment.