mirror of
https://github.com/nasa/openmct.git
synced 2025-04-23 18:33:46 +00:00
fix: handle AbortErrors gracefully
This commit is contained in:
parent
c7542d0052
commit
37dd237055
@ -195,6 +195,7 @@ export default {
|
||||
if (this.abortController !== null) {
|
||||
this.abortController.abort();
|
||||
}
|
||||
|
||||
this.abortController = new AbortController();
|
||||
const allAnnotationsForTarget = await this.openmct.annotation.getAnnotations(
|
||||
target.identifier,
|
||||
|
@ -309,14 +309,20 @@ export default {
|
||||
async created() {
|
||||
this.transaction = null;
|
||||
this.abortController = new AbortController();
|
||||
await this.loadAnnotations();
|
||||
try {
|
||||
await this.loadAnnotations();
|
||||
} catch (err) {
|
||||
if (err.name !== 'AbortError') {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
mounted() {
|
||||
this.formatSidebar();
|
||||
this.setSectionAndPageFromUrl();
|
||||
|
||||
this.openmct.selection.on('change', this.updateSelection);
|
||||
|
||||
|
||||
window.addEventListener('orientationchange', this.formatSidebar);
|
||||
window.addEventListener('hashchange', this.setSectionAndPageFromUrl);
|
||||
this.filterAndSortEntries();
|
||||
@ -324,8 +330,8 @@ export default {
|
||||
this.domainObject,
|
||||
'*',
|
||||
this.filterAndSortEntries
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.abortController.abort();
|
||||
if (this.unlisten) {
|
||||
@ -431,7 +437,11 @@ export default {
|
||||
: [...filteredPageEntriesByTime].reverse();
|
||||
|
||||
if (this.lastLocalAnnotationCreation < this.domainObject.annotationLastCreated) {
|
||||
this.loadAnnotations();
|
||||
this.loadAnnotations().catch((err) => {
|
||||
if (err.name !== 'AbortError') {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
changeSelectedSection({ sectionId, pageId }) {
|
||||
|
@ -331,9 +331,6 @@ export default {
|
||||
return this.pending === 0 && this.loaded;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.abortController = new AbortController();
|
||||
},
|
||||
watch: {
|
||||
initGridLines(newGridLines) {
|
||||
this.gridLines = newGridLines;
|
||||
@ -342,6 +339,9 @@ export default {
|
||||
this.cursorGuide = newCursorGuide;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.abortController = new AbortController();
|
||||
},
|
||||
mounted() {
|
||||
this.yAxisIdVisibility = {};
|
||||
this.offsetWidth = 0;
|
||||
@ -1529,7 +1529,11 @@ export default {
|
||||
this.endMarquee();
|
||||
}
|
||||
|
||||
this.loadAnnotations();
|
||||
this.loadAnnotations().catch((err) => {
|
||||
if (err.name !== 'AbortError') {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
zoom(zoomDirection, zoomFactor) {
|
||||
|
@ -98,9 +98,10 @@ export default {
|
||||
}
|
||||
|
||||
return 'Could not find any matching Notebook entries';
|
||||
} else if (this.result.annotationType === this.openmct.annotation.ANNOTATION_TYPES.MAP) {
|
||||
} else if (this.result.annotationType === this.openmct.annotation.ANNOTATION_TYPES.MAP) {
|
||||
const targetID = Object.keys(this.result.targets)[0];
|
||||
const { layerName, name } = this.result.targets[targetID];
|
||||
|
||||
return layerName ? `${layerName} - ${name}` : name;
|
||||
} else {
|
||||
return this.result.targetModels[0].name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user