mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 01:42:31 +00:00
Fixes isMutable error when domainobject is undefined (#3690)
* fix isMutable error when domainobject is undefined Co-authored-by: Deep Tailor <deep.j.tailor@nasa.com> Co-authored-by: Shefali Joshi <simplyrender@gmail.com> Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
parent
fc59a4dce4
commit
f789775b1c
@ -109,7 +109,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
domainObject: undefined,
|
||||
currentObjectPath: []
|
||||
currentObjectPath: [],
|
||||
mutablePromise: undefined
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -130,7 +131,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
if (this.openmct.objects.supportsMutation(this.item.identifier)) {
|
||||
this.openmct.objects.getMutable(this.item.identifier)
|
||||
this.mutablePromise = this.openmct.objects.getMutable(this.item.identifier)
|
||||
.then(this.setObject);
|
||||
} else {
|
||||
this.openmct.objects.get(this.item.identifier)
|
||||
@ -142,13 +143,18 @@ export default {
|
||||
this.removeSelectable();
|
||||
}
|
||||
|
||||
if (this.domainObject.isMutable) {
|
||||
if (this.mutablePromise) {
|
||||
this.mutablePromise.then(() => {
|
||||
this.openmct.objects.destroyMutable(this.domainObject);
|
||||
});
|
||||
} else {
|
||||
this.openmct.objects.destroyMutable(this.domainObject);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setObject(domainObject) {
|
||||
this.domainObject = domainObject;
|
||||
this.mutablePromise = undefined;
|
||||
this.currentObjectPath = [this.domainObject].concat(this.objectPath.slice());
|
||||
this.$nextTick(() => {
|
||||
let reference = this.$refs.objectFrame;
|
||||
|
@ -131,7 +131,8 @@ export default {
|
||||
domainObject: undefined,
|
||||
formats: undefined,
|
||||
viewKey: `alphanumeric-format-${Math.random()}`,
|
||||
status: ''
|
||||
status: '',
|
||||
mutablePromise: undefined
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -213,7 +214,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
if (this.openmct.objects.supportsMutation(this.item.identifier)) {
|
||||
this.openmct.objects.getMutable(this.item.identifier)
|
||||
this.mutablePromise = this.openmct.objects.getMutable(this.item.identifier)
|
||||
.then(this.setObject);
|
||||
} else {
|
||||
this.openmct.objects.get(this.item.identifier)
|
||||
@ -235,7 +236,11 @@ export default {
|
||||
|
||||
this.openmct.time.off("bounds", this.refreshData);
|
||||
|
||||
if (this.domainObject.isMutable) {
|
||||
if (this.mutablePromise) {
|
||||
this.mutablePromise.then(() => {
|
||||
this.openmct.objects.destroyMutable(this.domainObject);
|
||||
});
|
||||
} else {
|
||||
this.openmct.objects.destroyMutable(this.domainObject);
|
||||
}
|
||||
},
|
||||
@ -296,6 +301,7 @@ export default {
|
||||
},
|
||||
setObject(domainObject) {
|
||||
this.domainObject = domainObject;
|
||||
this.mutablePromise = undefined;
|
||||
this.keyString = this.openmct.objects.makeKeyString(domainObject.identifier);
|
||||
this.metadata = this.openmct.telemetry.getMetadata(this.domainObject);
|
||||
this.limitEvaluator = this.openmct.telemetry.limitEvaluator(this.domainObject);
|
||||
|
Loading…
x
Reference in New Issue
Block a user