From 5f7e34ce6cfb8752af00c0567af133e9868918c9 Mon Sep 17 00:00:00 2001 From: Jamie V Date: Mon, 5 Oct 2020 10:41:49 -0700 Subject: [PATCH] Tracking navigation requests, if multiple, only finish on latest (#3403) --- src/ui/layout/mct-tree.vue | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/ui/layout/mct-tree.vue b/src/ui/layout/mct-tree.vue index a466c7c05d..a28830832e 100644 --- a/src/ui/layout/mct-tree.vue +++ b/src/ui/layout/mct-tree.vue @@ -193,10 +193,6 @@ export default { }, watch: { syncTreeNavigation() { - if (this.isLoading) { - return; - } - const AND_SAVE_PATH = true; let currentLocationPath = this.openmct.router.currentLocation.path; let hasParent = this.currentlyViewedObjectParentPath() || (this.multipleRootChildren && !this.currentlyViewedObjectParentPath()); @@ -441,6 +437,9 @@ export default { } }, async getAllChildren(node) { + let currentNavigationRequest = this.openmct.objects.makeKeyString(node.object.identifier); + this.latestNavigationRequest = currentNavigationRequest; + await this.clearVisibleItems(); this.isLoading = true; @@ -455,7 +454,10 @@ export default { this.composition.on('add', this.addChild); this.composition.on('remove', this.removeChild); await this.composition.load(); - this.finishLoading(); + + if (currentNavigationRequest === this.latestNavigationRequest) { + this.finishLoading(); + } }, buildTreeItem(domainObject) { let navToParent = ROOT_PATH + this.currentNavigatedPath; @@ -636,20 +638,12 @@ export default { this.setContainerHeight(); }, handleReset(node) { - if (this.isLoading) { - return; - } - this.childrenSlideClass = 'up'; this.ancestors.splice(this.ancestors.indexOf(node) + 1); this.getAllChildren(node); this.setCurrentNavigatedPath(); }, handleExpanded(node) { - if (this.activeSearch || this.isLoading) { - return; - } - this.childrenSlideClass = 'down'; let newParent = this.buildTreeItem(node); this.ancestors.push(newParent);