This commit is contained in:
Girish Ramakrishnan
2018-06-12 13:37:31 -07:00
parent 59481c37bc
commit aa32055aa8

View File

@@ -1,7 +1,5 @@
'use strict';
/* global asyncForEach:false */
angular.module('Application').controller('EmailController', ['$scope', '$location', '$timeout', '$rootScope', 'Client', function ($scope, $location, $timeout, $rootScope, Client) {
Client.onReady(function () { if (!Client.hasScope('mail')) $location.path('/'); });
@@ -120,7 +118,9 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
show: function (list) {
$scope.mailinglists.edit.name = list.name;
var members = list.members.map(function (name) { return $scope.mailboxes.mailboxes.find(function (m) { return m.name === name; })});
var members = list.members.map(function (name) {
return $scope.mailboxes.mailboxes.find(function (m) { return m.name === name; });
});
// A mailinglist may contain mailbox names, which do not exist, so remove them here
$scope.mailinglists.edit.members = members.filter(function (m) { return !!m; });