@@ -8,10 +8,11 @@ import {LoaderWrapper} from '../../components/LoaderWrapper/LoaderWrapper';
88import SplitPane from '../../components/SplitPane' ;
99import { setHeaderBreadcrumbs } from '../../store/reducers/header/header' ;
1010import { overviewApi } from '../../store/reducers/overview/overview' ;
11+ import { selectSchemaObjectData } from '../../store/reducers/schema/schema' ;
1112import type { AdditionalNodesProps , AdditionalTenantsProps } from '../../types/additionalProps' ;
1213import { cn } from '../../utils/cn' ;
1314import { DEFAULT_IS_TENANT_SUMMARY_COLLAPSED , DEFAULT_SIZE_TENANT_KEY } from '../../utils/constants' ;
14- import { useAutoRefreshInterval , useTypedDispatch } from '../../utils/hooks' ;
15+ import { useAutoRefreshInterval , useTypedDispatch , useTypedSelector } from '../../utils/hooks' ;
1516import { isAccessError } from '../../utils/response' ;
1617
1718import ObjectGeneral from './ObjectGeneral/ObjectGeneral' ;
@@ -100,8 +101,18 @@ export function Tenant(props: TenantProps) {
100101 pollingInterval : autoRefreshInterval ,
101102 } ,
102103 ) ;
103- const { PathType : currentPathType , PathSubType : currentPathSubType } =
104- currentItem ?. PathDescription ?. Self || { } ;
104+
105+ const preloadedData = useTypedSelector ( ( state ) =>
106+ selectSchemaObjectData ( state , path , tenantName ) ,
107+ ) ;
108+
109+ // Use preloaded data if there is no current item data yet
110+ const currentPathType =
111+ currentItem ?. PathDescription ?. Self ?. PathType ??
112+ preloadedData ?. PathDescription ?. Self ?. PathType ;
113+ const currentPathSubType =
114+ currentItem ?. PathDescription ?. Self ?. PathSubType ??
115+ preloadedData ?. PathDescription ?. Self ?. PathSubType ;
105116
106117 const showBlockingError = isAccessError ( error ) ;
107118
0 commit comments