Skip to content

Commit e67c1e3

Browse files
committed
fix(users-table): add isFetching prop to DataTable for improved loading state handling
1 parent 2e65f45 commit e67c1e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dashboard/src/components/users/users-table.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ const UsersTable = memo(() => {
136136
data: usersData,
137137
refetch,
138138
isLoading,
139+
isFetching,
139140
} = useGetUsers(filters, {
140141
query: {
141142
staleTime: 0,
@@ -349,7 +350,7 @@ const UsersTable = memo(() => {
349350
setCurrentPage(0)
350351
}}
351352
/>
352-
<DataTable columns={columns} data={usersData?.users || []} isLoading={showLoadingSpinner} isFetching={false} onEdit={handleEdit} />
353+
<DataTable columns={columns} data={usersData?.users || []} isLoading={showLoadingSpinner} isFetching={isFetching && !isFirstLoadRef.current} onEdit={handleEdit} />
353354
<PaginationControls
354355
currentPage={currentPage}
355356
totalPages={totalPages}

0 commit comments

Comments
 (0)