mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(core): nav tree error handling
This commit is contained in:
@@ -44,6 +44,7 @@ export function useNavigationTree(nodeId: string, parentId: string) {
|
||||
const state = await navigationTreeService.loadNestedNodes(nodeId);
|
||||
if (!state) {
|
||||
switchExpand(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
switchExpand(!isExpanded);
|
||||
@@ -70,7 +71,9 @@ export function useNavigationTree(nodeId: string, parentId: string) {
|
||||
|
||||
useEffect(() => {
|
||||
if (isExpanded && !children.isLoaded && !children.isLoading && !!children.children && nodeLoaded) {
|
||||
navigationTreeService.loadNestedNodes(nodeId);
|
||||
navigationTreeService
|
||||
.loadNestedNodes(nodeId)
|
||||
.then(state => !state && switchExpand(false));
|
||||
}
|
||||
}, [isExpanded, children.isLoaded, children.isLoading, children.children, nodeLoaded, nodeId]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user