From f91e75f00dcdbca9f93c453d92cc4216620f9640 Mon Sep 17 00:00:00 2001 From: Wroud Date: Wed, 6 Apr 2022 16:24:35 +0300 Subject: [PATCH] fix(core-app): CB-1881 nav node info update --- .../src/NavigationTree/ElementsTree/useElementsTree.ts | 2 +- .../src/shared/NodesManager/NavNodeInfoResource.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/webapp/packages/core-app/src/NavigationTree/ElementsTree/useElementsTree.ts b/webapp/packages/core-app/src/NavigationTree/ElementsTree/useElementsTree.ts index ea0b0958d2..64b641383c 100644 --- a/webapp/packages/core-app/src/NavigationTree/ElementsTree/useElementsTree.ts +++ b/webapp/packages/core-app/src/NavigationTree/ElementsTree/useElementsTree.ts @@ -128,8 +128,8 @@ export function useElementsTree(options: IOptions): IElementsTree { const nextChildren: string[] = []; for (const child of children) { - await navNodeInfoResource.waitLoad(); await navTreeResource.waitLoad(); + await navNodeInfoResource.waitLoad(); const expanded = elementsTree.isNodeExpanded(child, true); if (!expanded && child !== options.root) { diff --git a/webapp/packages/core-app/src/shared/NodesManager/NavNodeInfoResource.ts b/webapp/packages/core-app/src/shared/NodesManager/NavNodeInfoResource.ts index 0c0510d6f7..e1c4c5bdd8 100644 --- a/webapp/packages/core-app/src/shared/NodesManager/NavNodeInfoResource.ts +++ b/webapp/packages/core-app/src/shared/NodesManager/NavNodeInfoResource.ts @@ -40,6 +40,8 @@ export class NavNodeInfoResource extends CachedMapResource { makeObservable(this, { setDetails: action, + updateNode: action, + setParent: action, }); this.metadata = new MetadataMap(() => ({ @@ -72,10 +74,9 @@ export class NavNodeInfoResource extends CachedMapResource { if (keyList.length > 0) { this.set(resourceKeyList(keyList), values); - } else { - this.markUpdated(key); - this.onItemAdd.execute(key); } + this.markUpdated(key); + this.onItemAdd.execute(key); } setDetails(keyObject: ResourceKey, state: boolean): void {