@@ -7,11 +7,11 @@ import {PageError} from '../../components/Errors/PageError/PageError';
77import { LoaderWrapper } from '../../components/LoaderWrapper/LoaderWrapper' ;
88import SplitPane from '../../components/SplitPane' ;
99import { setHeaderBreadcrumbs } from '../../store/reducers/header/header' ;
10- import { overviewApi } from '../../store/reducers/overview/overview ' ;
10+ import { selectSchemaData } from '../../store/reducers/schema/schema ' ;
1111import type { AdditionalNodesProps , AdditionalTenantsProps } from '../../types/additionalProps' ;
1212import { cn } from '../../utils/cn' ;
1313import { DEFAULT_IS_TENANT_SUMMARY_COLLAPSED , DEFAULT_SIZE_TENANT_KEY } from '../../utils/constants' ;
14- import { useAutoRefreshInterval , useTypedDispatch } from '../../utils/hooks' ;
14+ import { useTypedDispatch , useTypedSelector } from '../../utils/hooks' ;
1515import { isAccessError } from '../../utils/response' ;
1616
1717import ObjectGeneral from './ObjectGeneral/ObjectGeneral' ;
@@ -42,7 +42,6 @@ interface TenantProps {
4242}
4343
4444export function Tenant ( props : TenantProps ) {
45- const [ autoRefreshInterval ] = useAutoRefreshInterval ( ) ;
4645 const [ summaryVisibilityState , dispatchSummaryVisibilityAction ] = React . useReducer (
4746 paneVisibilityToggleReducerCreator ( DEFAULT_IS_TENANT_SUMMARY_COLLAPSED ) ,
4847 undefined ,
@@ -90,18 +89,12 @@ export function Tenant(props: TenantProps) {
9089
9190 const path = schema ?? tenantName ;
9291
93- const {
94- currentData : currentItem ,
95- error,
96- isLoading,
97- } = overviewApi . useGetOverviewQuery (
98- { path, database : tenantName } ,
99- {
100- pollingInterval : autoRefreshInterval ,
101- } ,
92+ const { data, isLoading, error} = useTypedSelector ( ( state ) =>
93+ selectSchemaData ( state , path , tenantName ) ,
10294 ) ;
95+
10396 const { PathType : currentPathType , PathSubType : currentPathSubType } =
104- currentItem ?. PathDescription ?. Self || { } ;
97+ data ?. [ path ] ?. PathDescription ?. Self || { } ;
10598
10699 const showBlockingError = isAccessError ( error ) ;
107100
0 commit comments