From aa86729f9a2ab95346a2851e3837de1c367aae17 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 20 Jun 2025 11:37:31 +0000
Subject: (대표님) 20250620 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/data-table/use-table-presets.tsx | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

(limited to 'components/data-table/use-table-presets.tsx')

diff --git a/components/data-table/use-table-presets.tsx b/components/data-table/use-table-presets.tsx
index 5e641762..f9ecda2a 100644
--- a/components/data-table/use-table-presets.tsx
+++ b/components/data-table/use-table-presets.tsx
@@ -288,17 +288,19 @@ export function useTablePresets<TData>(
   }, [mutate])
 
   // 클라이언트 상태 업데이트 (컬럼 가시성, 핀 등)
-  const updateClientState = useCallback(async (newClientState: Partial<TableSettings<TData>>) => {
-    if (!activePreset) return
-
-    const updatedSettings = {
-      ...activePreset.settings,
-      ...newClientState
-    }
-
-    await updatePreset(activePreset.id, updatedSettings)
-  }, [activePreset, updatePreset])
+  const updateClientState = useCallback(
+    async (newClientState: Partial<TableSettings<TData>>) => {
 
+      if (!activePreset) return;
+  
+      
+      const prev = activePreset.settings;
+      const next = { ...prev, ...newClientState };
+    
+      await updatePreset(activePreset.id, next);
+    },
+    [activePreset, updatePreset, tableId]   // ← tableId 도 의존성에 넣어 둡니다
+  );
   // URL 변경 감지 및 미저장 변경사항 체크
   useEffect(() => {
     if (!isClient || !presets || !activePreset) return
-- 
cgit v1.2.3

