From 9337915890e1b82603f6d47999eabf3e91e952b6 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 25 May 2022 13:27:57 -0400 Subject: [PATCH] fix(preferences(js)): prohibit deleting the last editable mail identity --- .../js/Preferences/AccountDialogController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/WebServerResources/js/Preferences/AccountDialogController.js b/UI/WebServerResources/js/Preferences/AccountDialogController.js index 6d3642172..b1544de9c 100644 --- a/UI/WebServerResources/js/Preferences/AccountDialogController.js +++ b/UI/WebServerResources/js/Preferences/AccountDialogController.js @@ -53,7 +53,7 @@ }); this.hasIdentities = function () { - return _.filter(this.account.identities, vm.isEditableIdentity).length > 0; + return _.filter(this.account.identities, this.isEditableIdentity).length > 0; }; this.isEditableIdentity = function (identity) { @@ -84,7 +84,7 @@ }; this.canRemoveIdentity = function (index) { - return (index == this.selectedIdentity) && (this.account.identities.length > 1); + return (index == this.selectedIdentity) && this.hasIdentities(); }; this.removeIdentity = function (index) {