Skip to content

Commit

Permalink
fix:생략시켜 추가 표시(+more)제거
Browse files Browse the repository at this point in the history
  • Loading branch information
HIITMEMARIO committed Aug 2, 2024
1 parent 698832b commit 9ac29fd
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ const FilteredAuthors = () => {
const { selectedData } = useGlobalData();
const authSrcMap = usePreLoadAuthorImg();
const selectedClusters = getInitData(selectedData);
const filteredSelectedData = selectedClusters.reverse().slice(0, 9);

const selectedClustersLength = selectedClusters.length - filteredSelectedData.length;

// 이미 선택된 사용자를 관리
const addedAuthors = new Set();

return (
<div className="selected-container">
{authSrcMap &&
filteredSelectedData.reverse().map((selectedCluster) => {
selectedClusters.map((selectedCluster) => {
return selectedCluster.summary.authorNames.map((authorArray: string[]) => {
return authorArray.map((authorName: string) => {
// 이미 추가된 사용자인지 확인 후 추가되지 않은 경우에만 추가하고 Set에 이름을 저장
Expand All @@ -38,7 +35,6 @@ const FilteredAuthors = () => {
});
});
})}
<div className="selected-length">{selectedClusters.length > 9 ? `+ ${selectedClustersLength} more` : null}</div>
</div>
);
};
Expand Down

0 comments on commit 9ac29fd

Please sign in to comment.