Do not use $index with angular sorted lists

This commit is contained in:
Johannes Zellner
2022-02-23 17:02:45 +01:00
parent 50f9624f4a
commit 10c0679d8f
2 changed files with 6 additions and 2 deletions

View File

@@ -586,8 +586,12 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
});
},
delAlias: function (event, index) {
delAlias: function (event, alias) {
event.preventDefault();
var index = $scope.mailboxes.edit.aliases.findIndex(function (a) { return (a.name+a.domain) === (alias.name+alias.domain); });
if (index === -1) return;
$scope.mailboxes.edit.aliases.splice(index, 1);
},