diff --git a/src/api/Editor.js b/src/api/Editor.js index 1520a4765c..471ca347c0 100644 --- a/src/api/Editor.js +++ b/src/api/Editor.js @@ -79,9 +79,11 @@ export default class Editor extends EventEmitter { * @private */ cancel() { - this.getTransactionService().cancel(); + let cancelPromise = this.getTransactionService().cancel(); this.editing = false; this.emit('isEditing', false); + + return cancelPromise; } /** diff --git a/src/ui/layout/BrowseBar.vue b/src/ui/layout/BrowseBar.vue index a82775b575..7e4c667501 100644 --- a/src/ui/layout/BrowseBar.vue +++ b/src/ui/layout/BrowseBar.vue @@ -119,7 +119,10 @@ const PLACEHOLDER_OBJECT = {}; label: 'Ok', emphasis: true, callback: () => { - this.openmct.editor.cancel(); + this.openmct.editor.cancel().then(() => { + //refresh object view + this.openmct.layout.$refs.browseObject.show(this.domainObject, this.viewKey, false); + }); dialog.dismiss(); } }, @@ -228,7 +231,20 @@ const PLACEHOLDER_OBJECT = {}; this.isEditing = isEditing; }); }, + watch: { + domainObject() { + if (this.mutationObserver) { + this.mutationObserver(); + } + this.mutationObserver = this.openmct.objects.observe(this.domainObject, '*', (domainObject) => { + this.domainObject = domainObject; + }); + } + }, beforeDestroy: function () { + if (this.mutationObserver) { + this.mutationObserver(); + } document.removeEventListener('click', this.closeViewAndSaveMenu); window.removeEventListener('click', this.promptUserbeforeNavigatingAway); }