diff --git a/src/components/templates/IntegratedListTemplateV2.tsx b/src/components/templates/IntegratedListTemplateV2.tsx index 74cb922c..31d99d84 100644 --- a/src/components/templates/IntegratedListTemplateV2.tsx +++ b/src/components/templates/IntegratedListTemplateV2.tsx @@ -300,15 +300,19 @@ export function IntegratedListTemplateV2({ setAccumulatedMobileData(data); setLastAccumulatedPage(1); } else if (pagination.currentPage === lastAccumulatedPage + 1) { - // 다음 페이지: 기존 데이터에 누적 - setAccumulatedMobileData(prev => [...prev, ...data]); + // 다음 페이지: 기존 데이터에 누적 (중복 제거) + setAccumulatedMobileData(prev => { + const existingIds = new Set(prev.map(item => getItemId(item))); + const newItems = data.filter(item => !existingIds.has(getItemId(item))); + return [...prev, ...newItems]; + }); setLastAccumulatedPage(pagination.currentPage); } else if (pagination.currentPage !== lastAccumulatedPage) { // 페이지 점프 (예: PC에서 페이지 변경 후 모바일로): 현재 데이터만 표시 setAccumulatedMobileData(data); setLastAccumulatedPage(pagination.currentPage); } - }, [data, pagination.currentPage, pagination.totalItems, allData, enableMobileInfinityScroll, lastAccumulatedPage]); + }, [data, pagination.currentPage, pagination.totalItems, allData, enableMobileInfinityScroll, lastAccumulatedPage, getItemId]); // 탭 변경 감지: activeTab 변경 시 누적 데이터 리셋 // 주의: allData를 dependency에 넣으면 페이지 변경 시마다 리셋됨 (외부 훅 사용 시)