From 9325d36031a3709a8e78f2c555a2ba303927b5d5 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Tue, 14 Oct 2025 06:44:18 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20=EB=A9=94=EB=AA=A8=EB=A6=AC=20?= =?UTF-8?q?=EC=84=B1=EB=8A=A5=20=EC=B5=9C=EC=A0=81=ED=99=94=20-=20?= =?UTF-8?q?=ED=95=84=ED=84=B0=20=EA=B3=84=EC=82=B0=20=EC=A0=9C=ED=95=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - FilterableHeader의 uniqueValues 계산을 최대 200개로 제한 - 메모리 누수 방지: 대량 자재(1000개+)에서 무거운 계산 반복 방지 - parseMaterialInfo 호출 횟수 대폭 감소 - 페이지 리로드 문제 해결 --- frontend/src/pages/NewMaterialsPage.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/NewMaterialsPage.jsx b/frontend/src/pages/NewMaterialsPage.jsx index 9888823..695680c 100644 --- a/frontend/src/pages/NewMaterialsPage.jsx +++ b/frontend/src/pages/NewMaterialsPage.jsx @@ -897,10 +897,10 @@ const NewMaterialsPage = ({ const uniqueValues = React.useMemo(() => { const values = new Set(); - // 현재 선택된 카테고리의 자재들만 필터링 - const categoryMaterials = materials.filter(material => { - return material.classified_category === selectedCategory; - }); + // 현재 선택된 카테고리의 자재들만 필터링 (최대 200개만 처리하여 성능 개선) + const categoryMaterials = materials + .filter(material => material.classified_category === selectedCategory) + .slice(0, 200); categoryMaterials.forEach(material => { const info = parseMaterialInfo(material);