Tracking navigation requests, if multiple, only finish on latest (#3403)

This commit is contained in:
Jamie V 2020-10-05 10:41:49 -07:00 committed by GitHub
parent db33f0538a
commit 5f7e34ce6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);