diff --git a/src/views/apps.js b/src/views/apps.js index 3633f5059..6181b996d 100644 --- a/src/views/apps.js +++ b/src/views/apps.js @@ -468,13 +468,18 @@ angular.module('Application').controller('AppsController', ['$scope', '$location }, submit: function () { + $scope.appCancel.busy = true; + Client.stopTask($scope.appCancel.app.taskId, function (error) { if (error) Client.error(error); - $scope.appCancel.busy = false; - Client.refreshAppCache($scope.appCancel.app.id); // reflect the new app state immediately + setTimeout(function () { // small delay for UI + $scope.appCancel.busy = false; - $('#appCancelModal').modal('hide'); + Client.refreshAppCache($scope.appCancel.app.id); // reflect the new app state immediately + + $('#appCancelModal').modal('hide'); + }, 1000); }); return false; // prevent propagation and default