@@ -10,6 +10,7 @@ import {InternalLink} from '../../components/InternalLink';
1010import { ResizeableDataTable } from '../../components/ResizeableDataTable/ResizeableDataTable' ;
1111import { TableSkeleton } from '../../components/TableSkeleton/TableSkeleton' ;
1212import routes , { createHref } from '../../routes' ;
13+ import { selectAutoRefreshInterval } from '../../store/reducers/autoRefreshControl' ;
1314import { selectTabletsWithFqdn , tabletsApi } from '../../store/reducers/tablets' ;
1415import { ETabletState } from '../../types/api/tablet' ;
1516import type { TTabletStateInfo } from '../../types/api/tablet' ;
@@ -145,21 +146,24 @@ interface TabletsProps {
145146}
146147
147148export function Tablets ( { nodeId, path, className} : TabletsProps ) {
148- const { autorefresh } = useTypedSelector ( ( state ) => state . schema ) ;
149+ const autoRefreshInterval = useTypedSelector ( selectAutoRefreshInterval ) ;
149150
150- let params : TabletsApiRequestParams | typeof skipToken = skipToken ;
151+ let params : TabletsApiRequestParams = { } ;
151152 const node = nodeId === undefined ? undefined : String ( nodeId ) ;
152153 if ( node !== undefined ) {
153154 params = { nodes : [ String ( node ) ] } ;
154155 } else if ( path ) {
155156 params = { path} ;
156157 }
157- const { currentData, isFetching, error} = tabletsApi . useGetTabletsInfoQuery ( params , {
158- pollingInterval : autorefresh ,
159- } ) ;
158+ const { currentData, isFetching, error} = tabletsApi . useGetTabletsInfoQuery (
159+ Object . keys ( params ) . length === 0 ? skipToken : params ,
160+ {
161+ pollingInterval : autoRefreshInterval ,
162+ } ,
163+ ) ;
160164
161165 const loading = isFetching && currentData === undefined ;
162- const tablets = useTypedSelector ( ( state ) => selectTabletsWithFqdn ( state , node , path ) ) ;
166+ const tablets = useTypedSelector ( ( state ) => selectTabletsWithFqdn ( state , params ) ) ;
163167
164168 if ( loading ) {
165169 return < TableSkeleton /> ;
0 commit comments