mirror of
https://github.com/nasa/openmct.git
synced 2025-03-22 12:05:19 +00:00
fix(#5646): abort pending annotations requests on nav away from notebooks or plots
This commit is contained in:
parent
f4007d3dfc
commit
c7542d0052
@ -306,14 +306,17 @@ export default {
|
||||
this.getSearchResults = debounce(this.getSearchResults, 500);
|
||||
this.syncUrlWithPageAndSection = debounce(this.syncUrlWithPageAndSection, 100);
|
||||
},
|
||||
async mounted() {
|
||||
async created() {
|
||||
this.transaction = null;
|
||||
this.abortController = new AbortController();
|
||||
await this.loadAnnotations();
|
||||
},
|
||||
async mounted() {
|
||||
this.formatSidebar();
|
||||
this.setSectionAndPageFromUrl();
|
||||
|
||||
this.openmct.selection.on('change', this.updateSelection);
|
||||
this.transaction = null;
|
||||
|
||||
|
||||
window.addEventListener('orientationchange', this.formatSidebar);
|
||||
window.addEventListener('hashchange', this.setSectionAndPageFromUrl);
|
||||
this.filterAndSortEntries();
|
||||
@ -321,9 +324,10 @@ export default {
|
||||
this.domainObject,
|
||||
'*',
|
||||
this.filterAndSortEntries
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.abortController.abort();
|
||||
if (this.unlisten) {
|
||||
this.unlisten();
|
||||
}
|
||||
@ -387,8 +391,10 @@ export default {
|
||||
this.lastLocalAnnotationCreation = this.domainObject.annotationLastCreated ?? 0;
|
||||
|
||||
const foundAnnotations = await this.openmct.annotation.getAnnotations(
|
||||
this.domainObject.identifier
|
||||
this.domainObject.identifier,
|
||||
this.abortController.signal
|
||||
);
|
||||
|
||||
foundAnnotations.forEach((foundAnnotation) => {
|
||||
const targetId = Object.keys(foundAnnotation.targets)[0];
|
||||
const entryId = foundAnnotation.targets[targetId].entryId;
|
||||
|
@ -331,6 +331,9 @@ export default {
|
||||
return this.pending === 0 && this.loaded;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.abortController = new AbortController();
|
||||
},
|
||||
watch: {
|
||||
initGridLines(newGridLines) {
|
||||
this.gridLines = newGridLines;
|
||||
@ -398,6 +401,7 @@ export default {
|
||||
this.loaded = true;
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.abortController.abort();
|
||||
this.openmct.selection.off('change', this.updateSelection);
|
||||
document.removeEventListener('keydown', this.handleKeyDown);
|
||||
document.removeEventListener('keyup', this.handleKeyUp);
|
||||
@ -621,7 +625,8 @@ export default {
|
||||
await Promise.all(
|
||||
this.seriesModels.map(async (seriesModel) => {
|
||||
const seriesAnnotations = await this.openmct.annotation.getAnnotations(
|
||||
seriesModel.model.identifier
|
||||
seriesModel.model.identifier,
|
||||
this.abortController.signal
|
||||
);
|
||||
rawAnnotationsForPlot.push(...seriesAnnotations);
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user