From de2ac5a2860bc25180971e7a11f852d9d44675b7 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 6 Aug 2025 04:23:40 +0000
Subject: (대표님) 정기평가, 법적검토, 정책, 가입관련 처리 및 관련 컴포넌트
 추가, 메뉴 변경
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/data-table/data-table-view-options.tsx | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

(limited to 'components/data-table/data-table-view-options.tsx')

diff --git a/components/data-table/data-table-view-options.tsx b/components/data-table/data-table-view-options.tsx
index 422e3065..b689adab 100644
--- a/components/data-table/data-table-view-options.tsx
+++ b/components/data-table/data-table-view-options.tsx
@@ -39,6 +39,7 @@ import {
 } from "@/components/ui/sortable"
 import { useTranslation } from '@/i18n/client'
 import { useParams, usePathname } from "next/navigation";
+import deepEqual from "fast-deep-equal"
 
 
 /**
@@ -70,6 +71,7 @@ export function DataTableViewOptions<TData>({
 }: DataTableViewOptionsProps<TData>) {
   const triggerRef = React.useRef<HTMLButtonElement>(null)
 
+
   const params = useParams();
     const lng = params?.lng as string;
   const { t } = useTranslation(lng);
@@ -115,11 +117,11 @@ export function DataTableViewOptions<TData>({
     const finalOrder = [...nonHideable, ...columnOrder]
 
     // Now we set the table's official column order
-    table.setColumnOrder(finalOrder)
-    
-    // Reset auto-size when column order changes
-    resetAutoSize?.()
-  }, [columnOrder, hideableCols, table, resetAutoSize])
+      if (!deepEqual(table.getState().columnOrder, finalOrder)) {
+          table.setColumnOrder(finalOrder)
+          resetAutoSize?.()
+        }
+  }, [columnOrder, hideableCols.join("|"), table, resetAutoSize])
 
 
   return (
-- 
cgit v1.2.3

