From 6328bd9354c40dfb4bb4a7b7261a4c77a8117e2a Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 20 Dec 2016 15:28:15 -0800 Subject: [PATCH] [Edit] Cancel action depends on promise resolution Cancel action no longer cares about return value, simply will not execute if navigtion promise does not resolve. https://github.com/nasa/openmct/issues/1360 --- platform/commonUI/edit/src/actions/CancelAction.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/commonUI/edit/src/actions/CancelAction.js b/platform/commonUI/edit/src/actions/CancelAction.js index a48ceec996..474939cb1d 100644 --- a/platform/commonUI/edit/src/actions/CancelAction.js +++ b/platform/commonUI/edit/src/actions/CancelAction.js @@ -56,13 +56,13 @@ define( //navigate back to parent because nothing to show. return domainObject.getCapability("location").getOriginal().then(function (original) { parent = original.getCapability("context").getParent(); - parent.getCapability("action").perform("navigate"); + return parent.getCapability("action").perform("navigate"); }); } } - function cancel(allowed) { - return allowed && domainObject.getCapability("editor").finish(); + function cancel() { + return domainObject.getCapability("editor").finish(); } //Do navigation first in order to trigger unsaved changes dialog