diff --git a/src/js/client.js b/src/js/client.js index 2fd491e04..5f9e5fa0f 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -377,6 +377,8 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N enableBackup: config.enableBackup }; + if ('mailboxName' in config) data.mailboxName = config.mailboxName; + post('/api/v1/apps/' + id + '/configure', data).success(function (data, status) { if (status !== 202) return callback(new ClientError(status, data)); callback(null); diff --git a/src/views/apps.js b/src/views/apps.js index aac6ce28e..f7623b49d 100644 --- a/src/views/apps.js +++ b/src/views/apps.js @@ -136,6 +136,10 @@ angular.module('Application').controller('AppsController', ['$scope', '$location if (error) { if (error.statusCode === 409 && (error.message.indexOf('is reserved') !== -1 || error.message.indexOf('is already in use') !== -1)) { $scope.appConfigure.error.port = error.message; + } else if (error.statusCode === 409 && error.message.indexOf('mailbox') !== -1 ) { + $scope.appConfigure.error.mailboxName = error.message; + $scope.appConfigureForm.mailboxName.$setPristine(); + $('#appConfigureMailboxNameInput').focus(); } else if (error.statusCode === 409) { $scope.appConfigure.error.location = 'This name is already taken.'; $scope.appConfigureForm.location.$setPristine(); @@ -150,10 +154,6 @@ angular.module('Application').controller('AppsController', ['$scope', '$location $scope.appConfigure.error.xFrameOptions = error.message; $scope.appConfigureForm.xFrameOptions.$setPristine(); $('#appConfigureXFrameOptionsInput').focus(); - } else if (error.statusCode === 400 && error.message.indexOf('mailbox') !== -1 ) { - $scope.appConfigure.error.mailboxName = error.message; - $scope.appConfigureForm.mailboxName.$setPristine(); - $('#appConfigureMailboxNameInput').focus(); } else { $scope.appConfigure.error.other = error.message; }