@@ -89,7 +89,7 @@ export const Filters = ({ filters, onFilterChange, refetch, autoRefetch, advance
8989 const [ search , setSearch ] = useState ( filters . search || '' )
9090 const [ isRefreshing , setIsRefreshing ] = useState ( false )
9191 const [ autoRefreshInterval , setAutoRefreshInterval ] = useState < number > ( ( ) => getUsersAutoRefreshIntervalSeconds ( ) )
92- const { refetch : queryRefetch } = useGetUsers ( filters )
92+ const { refetch : queryRefetch , isFetching } = useGetUsers ( filters )
9393 const refetchUsers = useCallback ( async ( showLoading = false , isAutoRefresh = false ) => {
9494 if ( showLoading ) {
9595 setIsRefreshing ( true )
@@ -297,15 +297,15 @@ export const Filters = ({ filters, onFilterChange, refetch, autoRefetch, advance
297297 className = { cn (
298298 'relative flex h-9 w-9 items-center justify-center border transition-all duration-200 md:h-10 md:w-10' ,
299299 dir === 'rtl' ? 'rounded-l-none border-l-0' : 'rounded-r-none' ,
300- isRefreshing && 'opacity-70' ,
300+ ( isRefreshing || isFetching ) && 'opacity-70' ,
301301 ) }
302302 aria-label = { t ( 'autoRefresh.refreshNow' ) }
303303 title = { t ( 'autoRefresh.refreshNow' ) }
304- disabled = { isRefreshing }
304+ disabled = { isRefreshing || isFetching }
305305 >
306- < RefreshCw className = { cn ( ' h-4 w-4 transition-transform duration-200' , isRefreshing && 'animate-spin' ) } />
306+ < RefreshCw className = " h-4 w-4" />
307307 < div className = "absolute -right-1 -top-1 flex items-center justify-center" >
308- { isRefreshing ? (
308+ { isRefreshing || isFetching ? (
309309 < div className = "flex h-3 w-3 items-center justify-center rounded-full bg-primary transition-all duration-200 ease-in-out" >
310310 < LoaderCircle className = "h-2 w-2 animate-spin text-primary-foreground" />
311311 </ div >
@@ -336,12 +336,12 @@ export const Filters = ({ filters, onFilterChange, refetch, autoRefetch, advance
336336 < DropdownMenuSeparator />
337337 < DropdownMenuItem
338338 onSelect = { ( ) => void handleRefreshClick ( ) }
339- disabled = { isRefreshing }
340- className = { cn ( 'flex items-center gap-1.5 px-1.5 py-1 text-[11px] transition-opacity duration-200' , isRefreshing && 'opacity-70' ) }
339+ disabled = { isRefreshing || isFetching }
340+ className = { cn ( 'flex items-center gap-1.5 px-1.5 py-1 text-[11px] transition-opacity duration-200' , ( isRefreshing || isFetching ) && 'opacity-70' ) }
341341 >
342- < RefreshCw className = { cn ( ' h-2.5 w-2.5 flex-shrink-0 transition-transform duration-200' , isRefreshing && 'animate-spin' ) } />
342+ < RefreshCw className = " h-2.5 w-2.5 flex-shrink-0" />
343343 < span className = "truncate" > { t ( 'autoRefresh.refreshNow' ) } </ span >
344- { isRefreshing && < LoaderCircle className = "ml-auto h-2.5 w-2.5 animate-spin text-primary" /> }
344+ { ( isRefreshing || isFetching ) && < LoaderCircle className = "ml-auto h-2.5 w-2.5 animate-spin text-primary" /> }
345345 </ DropdownMenuItem >
346346 < DropdownMenuSeparator />
347347 { autoRefreshOptions . map ( option => {
0 commit comments