Show dialog when disabling email

This commit is contained in:
Girish Ramakrishnan
2018-05-06 23:36:40 -07:00
parent 1b1d4ee431
commit a07848164c
2 changed files with 26 additions and 8 deletions
+5 -6
View File
@@ -183,13 +183,10 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
$scope.toggleEmailEnabled = function () {
if ($scope.selectedDomain.mailConfig.enabled) {
$scope.disableEmail();
$scope.refreshDomain();
return;
$('#disableEmailModal').modal('show');
} else {
$('#enableEmailModal').modal('show');
}
// show warning first
$('#enableEmailModal').modal('show');
};
$scope.enableEmail = function () {
@@ -202,6 +199,8 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
};
$scope.disableEmail = function () {
$('#disableEmailModal').modal('hide');
Client.enableMailForDomain($scope.selectedDomain.domain, false , function (error) {
if (error) return console.error(error);
$scope.refreshDomain();