From cd961a2162975f41f93432ec2d99c0c9846fb961 Mon Sep 17 00:00:00 2001 From: kjs Date: Thu, 6 Nov 2025 12:24:12 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=99=94=EB=A9=B4=20=EB=B3=B5=EA=B7=80?= =?UTF-8?q?=20=EC=8B=9C=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC=20=EB=A7=A4?= =?UTF-8?q?=ED=95=91=20=EA=B0=B1=EC=8B=A0=20=EB=B3=B4=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - loading 상태를 의존성으로 변경 - 데이터 로드 완료 시점(loading: false)에 매핑 갱신 - 화면 전환 후 복귀 시에도 최신 카테고리 데이터 반영 - 로딩 중에는 매핑 로드하지 않도록 가드 추가 --- .../registry/components/table-list/TableListComponent.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/lib/registry/components/table-list/TableListComponent.tsx b/frontend/lib/registry/components/table-list/TableListComponent.tsx index 127cc08b..7b374507 100644 --- a/frontend/lib/registry/components/table-list/TableListComponent.tsx +++ b/frontend/lib/registry/components/table-list/TableListComponent.tsx @@ -430,6 +430,9 @@ export const TableListComponent: React.FC = ({ const loadCategoryMappings = async () => { if (!tableConfig.selectedTable || !columnMeta) return; + // 로딩 중에는 매핑 로드하지 않음 (데이터 로드 완료 후에만 실행) + if (loading) return; + try { const categoryColumns = Object.entries(columnMeta) .filter(([_, meta]) => meta.inputType === "category") @@ -443,7 +446,8 @@ export const TableListComponent: React.FC = ({ console.log("🔄 [TableList] 카테고리 매핑 로드 시작:", { table: tableConfig.selectedTable, categoryColumns, - refreshTrigger, + dataLength: data.length, + loading, }); const mappings: Record> = {}; @@ -479,7 +483,7 @@ export const TableListComponent: React.FC = ({ }; loadCategoryMappings(); - }, [tableConfig.selectedTable, columnMeta, data.length]); // data.length로 데이터 변경 감지 + }, [tableConfig.selectedTable, columnMeta, loading]); // loading이 false가 될 때마다 갱신! // ======================================== // 데이터 가져오기