Skip to content

Commit 3737de2

Browse files
fix(Tenant): fix tabs reset on schema object change
1 parent ba22a39 commit 3737de2

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/containers/Tenant/Tenant.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import {PageError} from '../../components/Errors/PageError/PageError';
77
import {LoaderWrapper} from '../../components/LoaderWrapper/LoaderWrapper';
88
import SplitPane from '../../components/SplitPane';
99
import {setHeaderBreadcrumbs} from '../../store/reducers/header/header';
10-
import {overviewApi} from '../../store/reducers/overview/overview';
10+
import {useGetSchemaQuery} from '../../store/reducers/schema/schema';
1111
import type {AdditionalNodesProps, AdditionalTenantsProps} from '../../types/additionalProps';
1212
import {cn} from '../../utils/cn';
1313
import {DEFAULT_IS_TENANT_SUMMARY_COLLAPSED, DEFAULT_SIZE_TENANT_KEY} from '../../utils/constants';
14-
import {useAutoRefreshInterval, useTypedDispatch} from '../../utils/hooks';
14+
import {useTypedDispatch} from '../../utils/hooks';
1515
import {isAccessError} from '../../utils/response';
1616

1717
import ObjectGeneral from './ObjectGeneral/ObjectGeneral';
@@ -42,7 +42,6 @@ interface TenantProps {
4242
}
4343

4444
export function Tenant(props: TenantProps) {
45-
const [autoRefreshInterval] = useAutoRefreshInterval();
4645
const [summaryVisibilityState, dispatchSummaryVisibilityAction] = React.useReducer(
4746
paneVisibilityToggleReducerCreator(DEFAULT_IS_TENANT_SUMMARY_COLLAPSED),
4847
undefined,
@@ -90,16 +89,8 @@ 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-
},
102-
);
92+
const {data: currentItem, error, isLoading} = useGetSchemaQuery({path, database: tenantName});
93+
10394
const {PathType: currentPathType, PathSubType: currentPathSubType} =
10495
currentItem?.PathDescription?.Self || {};
10596

0 commit comments

Comments
 (0)