dbeaver/pro#5192 adjust loading state process (#3360)

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
alex
2025-04-08 15:51:03 +08:00
committed by GitHub
co-authored by Daria Marutkina
parent 947dcb367e
commit e1a05496cb
2 changed files with 6 additions and 4 deletions
@@ -1,6 +1,6 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
@@ -25,8 +25,7 @@ export const ElementsTreeContentLoader = observer<React.PropsWithChildren<Props>
children,
}) {
const hasChildren = getComputed(() => context.tree.getNodeChildren(context.tree.root).length > 0);
const loading = getComputed(() => (childrenState.isLoading() || context.tree.isLoading()) && !context.tree.isLoaded());
const loading = getComputed(() => childrenState.isLoading() || context.tree.isLoading() || context.tree.isOutdated?.());
if (!hasChildren) {
if (loading) {
@@ -1,6 +1,6 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
@@ -421,6 +421,9 @@ export function useElementsTree(options: IOptions): IElementsTree {
isLoaded(): boolean {
return navNodeInfoResource.isLoaded(this.root);
},
isOutdated(): boolean {
return navNodeInfoResource.isOutdated(this.root);
},
getNodeState(nodeId: string) {
return this.state.get(nodeId);
},