Skip to content

Commit

Permalink
Allow setting email to nothing.
Browse files Browse the repository at this point in the history
Previously, once an email is added to an account, it was not possible to
remove it. Now an empty email address is accepted.
  • Loading branch information
kiswa committed Nov 8, 2015
1 parent 27ca92f commit 252de39
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions js/controllers/settingsUser.js
Expand Up @@ -135,20 +135,15 @@ function ($scope, $interval, UserService) {
$scope.changeEmail = function(newEmailFormData) {
$scope.emailFormData.isSaving = true;

if (newEmailFormData.newEmail === '') {
newEmailFormData.setAlert('Email cannot be blank.');
newEmailFormData.isSaving = false;
} else {
UserService.changeEmail(newEmailFormData.newEmail)
.success(function(data) {
$scope.alerts.showAlerts(data.alerts);
$scope.updateUsers(data.data);
$scope.loadCurrentUser();
UserService.changeEmail(newEmailFormData.newEmail)
.success(function(data) {
$scope.alerts.showAlerts(data.alerts);
$scope.updateUsers(data.data);
$scope.loadCurrentUser();

newEmailFormData.isSaving = false;
newEmailFormData.newUsername = '';
});
}
newEmailFormData.isSaving = false;
newEmailFormData.newUsername = '';
});
};

$scope.updatingDefaultBoard = false;
Expand Down

0 comments on commit 252de39

Please sign in to comment.