Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-4584 fix: loads object properties tabs after relogin correctly + added loader #2649

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { observer } from 'mobx-react-lite';
import { useEffect } from 'react';

import { s, TextPlaceholder, useOffsetPagination, useResource, useTranslate } from '@cloudbeaver/core-blocks';
import { Loader, s, TextPlaceholder, useOffsetPagination, useResource, useTranslate } from '@cloudbeaver/core-blocks';
import { useService } from '@cloudbeaver/core-di';
import { type DBObject, DBObjectParentKey, DBObjectResource, NavTreeResource } from '@cloudbeaver/core-navigation-tree';
import { isDefined } from '@cloudbeaver/core-utils';
Expand All @@ -26,11 +26,11 @@ interface ObjectPropertyTableProps {
export const ObjectPropertyTable = observer<ObjectPropertyTableProps>(function ObjectPropertyTable({ objectId, parentId, className }) {
const translate = useTranslate();
const navNodeViewService = useService(NavNodeViewService);
const navTreeResource = useService(NavTreeResource);
const navTreeResource = useResource(ObjectPropertyTable, NavTreeResource, objectId);

const pagination = useOffsetPagination(DBObjectResource, {
key: DBObjectParentKey(objectId),
pageSize: navTreeResource.childrenLimit,
pageSize: navTreeResource.resource.childrenLimit,
});

const dbObjectLoader = useResource(ObjectPropertyTable, DBObjectResource, pagination.key);
Expand All @@ -43,6 +43,10 @@ export const ObjectPropertyTable = observer<ObjectPropertyTableProps>(function O
navNodeViewService.logDuplicates(objectId, duplicates);
});

if (navTreeResource.loading || dbObjectLoader.loading) {
return <Loader />;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems strange, why it's not covered by suspense?


return (
<>
{nodes.length === 0 ? (
Expand Down
Loading