From e1a05496cb8fcd1ea814b441c11606bfce8750df Mon Sep 17 00:00:00 2001 From: alex <48489896+devnaumov@users.noreply.github.com> Date: Tue, 8 Apr 2025 09:51:03 +0200 Subject: [PATCH] dbeaver/pro#5192 adjust loading state process (#3360) Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com> --- .../ElementsTree/ElementsTreeContentLoader.tsx | 5 ++--- .../src/NavigationTree/ElementsTree/useElementsTree.ts | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/ElementsTreeContentLoader.tsx b/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/ElementsTreeContentLoader.tsx index 629d022ee3..87f1414c89 100644 --- a/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/ElementsTreeContentLoader.tsx +++ b/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/ElementsTreeContentLoader.tsx @@ -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 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) { diff --git a/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/useElementsTree.ts b/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/useElementsTree.ts index 183ecd117e..a2096a7fa4 100644 --- a/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/useElementsTree.ts +++ b/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/useElementsTree.ts @@ -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); },