From 10c0679d8f47f6ec2207c2dc86abd00a640ec546 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Wed, 23 Feb 2022 17:02:45 +0100 Subject: [PATCH] Do not use $index with angular sorted lists --- src/views/email.html | 2 +- src/views/email.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/email.html b/src/views/email.html index 9a212c831..77924d741 100644 --- a/src/views/email.html +++ b/src/views/email.html @@ -141,7 +141,7 @@
- +
diff --git a/src/views/email.js b/src/views/email.js index 8984aa4a6..087502d9b 100644 --- a/src/views/email.js +++ b/src/views/email.js @@ -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); },