Ensure catchall uses the same origin array as the dropdown model
Otherwise angular would not reliably detect the same objects
This commit is contained in:
@@ -44,6 +44,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
|
||||
$scope.catchall = {
|
||||
mailboxes: [],
|
||||
availableMailboxes: [],
|
||||
busy: false,
|
||||
|
||||
submit: function () {
|
||||
@@ -59,11 +60,13 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
},
|
||||
|
||||
refresh: function () {
|
||||
Client.getMailboxes($scope.domain.domain, '', 1, 1000, function (error, mailboxes) {
|
||||
Client.getMailboxes($scope.domain.domain, '', 1, 1000, function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.catchall.availableMailboxes = result;
|
||||
|
||||
$scope.catchall.mailboxes = $scope.domain.mailConfig.catchAll.map(function (name) {
|
||||
return mailboxes.find(function (m) { return m.name === name; });
|
||||
return $scope.catchall.availableMailboxes.find(function (m) { return m.name === name; });
|
||||
}).filter(function (m) { return !!m; });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user