mirror of
https://github.com/nasa/openmct.git
synced 2025-02-08 12:00:38 +00:00
fix: have loadAnnotationForTargetObject
take an abortSignal
This commit is contained in:
parent
b51654efbb
commit
f4007d3dfc
@ -123,6 +123,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
this.abortController = null;
|
||||
this.openmct.annotation.on('targetDomainObjectAnnotated', this.loadAnnotationForTargetObject);
|
||||
this.openmct.selection.on('change', this.updateSelection);
|
||||
await this.updateSelection(this.openmct.selection.get());
|
||||
@ -191,8 +192,13 @@ export default {
|
||||
},
|
||||
async loadAnnotationForTargetObject(target) {
|
||||
const targetID = this.openmct.objects.makeKeyString(target.identifier);
|
||||
if (this.abortController !== null) {
|
||||
this.abortController.abort();
|
||||
}
|
||||
this.abortController = new AbortController();
|
||||
const allAnnotationsForTarget = await this.openmct.annotation.getAnnotations(
|
||||
target.identifier
|
||||
target.identifier,
|
||||
this.abortController.signal
|
||||
);
|
||||
const filteredAnnotationsForSelection = allAnnotationsForTarget.filter((annotation) => {
|
||||
const matchingTargetID = Object.keys(annotation.targets).filter((loadedTargetID) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user