mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
dbeaver/pro#5192 adjust loading state process (#3360)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
+2
-3
@@ -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) {
|
||||
|
||||
+4
-1
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user