diff --git a/webapp/packages/core-navigation-tree/src/NodesManager/DBObjectResource.ts b/webapp/packages/core-navigation-tree/src/NodesManager/DBObjectResource.ts index e6fe3be622..1acbf23684 100644 --- a/webapp/packages/core-navigation-tree/src/NodesManager/DBObjectResource.ts +++ b/webapp/packages/core-navigation-tree/src/NodesManager/DBObjectResource.ts @@ -60,7 +60,6 @@ export class DBObjectResource extends CachedMapResource { }); this.beforeLoad.addHandler(async (originalKey, context) => { - await this.navTreeResource.waitLoad(); const parentKey = this.aliases.isAlias(originalKey, DBObjectParentKey); const pageKey = this.aliases.isAlias(originalKey, CachedResourceOffsetPageKey) || this.aliases.isAlias(originalKey, CachedResourceOffsetPageListKey); diff --git a/webapp/packages/core-resource/src/Resource/CachedResource.ts b/webapp/packages/core-resource/src/Resource/CachedResource.ts index 3c5d151279..f7d043ac79 100644 --- a/webapp/packages/core-resource/src/Resource/CachedResource.ts +++ b/webapp/packages/core-resource/src/Resource/CachedResource.ts @@ -336,8 +336,16 @@ export abstract class CachedResource< * Return promise that will be resolved when resource will finish loading pending requests. * Will be resolved immediately if resource is not loading. */ - waitLoad(): Promise { - return this.scheduler.wait(); + waitLoad(key?: ResourceKey): Promise { + if (key === undefined) { + return this.scheduler.wait(); + } + + if (isResourceAlias(key)) { + key = this.aliases.transformToKey(key); + } + + return this.scheduler.waitRelease(key); } isOutdated(param?: ResourceKey, includes?: TInclude): boolean { diff --git a/webapp/packages/plugin-data-viewer/src/DataViewerPage/useDataViewerPanel.ts b/webapp/packages/plugin-data-viewer/src/DataViewerPage/useDataViewerPanel.ts index 21991950f3..ff030250eb 100644 --- a/webapp/packages/plugin-data-viewer/src/DataViewerPage/useDataViewerPanel.ts +++ b/webapp/packages/plugin-data-viewer/src/DataViewerPage/useDataViewerPanel.ts @@ -48,7 +48,7 @@ export function useDataViewerPanel(tab: ITab) { } if (!model) { - await connectionInfoResource.waitLoad(); + await connectionInfoResource.waitLoad(tab.handlerState.connectionKey!); const connectionInfo = connectionInfoResource.get(tab.handlerState.connectionKey!); if (!connectionInfo) { 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 8f0e4f1e05..e258aece82 100644 --- a/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/useElementsTree.ts +++ b/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/useElementsTree.ts @@ -218,9 +218,9 @@ export function useElementsTree(options: IOptions): IElementsTree { async loadNode(nodeId: string) { await projectInfoResource.waitLoad(); - await connectionInfoResource.waitLoad(); - await navTreeResource.waitLoad(); - await navNodeInfoResource.waitLoad(); + await connectionInfoResource.waitLoad(ConnectionInfoActiveProjectKey); + await navTreeResource.waitLoad(nodeId); + await navNodeInfoResource.waitLoad(nodeId); const expanded = elementsTree.isNodeExpanded(nodeId, true); if (!expanded && nodeId !== options.root) { diff --git a/webapp/packages/plugin-navigation-tree/src/NavigationTree/NavigationTreeService.ts b/webapp/packages/plugin-navigation-tree/src/NavigationTree/NavigationTreeService.ts index a24e34646a..8b600e4f7d 100644 --- a/webapp/packages/plugin-navigation-tree/src/NavigationTree/NavigationTreeService.ts +++ b/webapp/packages/plugin-navigation-tree/src/NavigationTree/NavigationTreeService.ts @@ -98,7 +98,7 @@ export class NavigationTreeService extends View { } } - await this.navTreeResource.waitLoad(); + await this.navTreeResource.waitLoad(id); if (tryConnect && this.navTreeResource.getException(id)) { this.navTreeResource.markOutdated(id);