From fc121acff3e0e64a11530c30dcc1e3bccb6cf40b Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Thu, 25 Nov 2021 19:17:33 +0100 Subject: [PATCH] fix(addressbook(js)): custom field creation availableKeys will always be an array containing ["1", "2", "3", "4"] because currently the wrong customFields is not accessed correctly. This leads to the removal of CUSTOM1 if you wanna add a second custom field. --- UI/WebServerResources/js/Contacts/CardController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/WebServerResources/js/Contacts/CardController.js b/UI/WebServerResources/js/Contacts/CardController.js index de6417941..0380300fd 100644 --- a/UI/WebServerResources/js/Contacts/CardController.js +++ b/UI/WebServerResources/js/Contacts/CardController.js @@ -103,7 +103,7 @@ }; this.canAddCustomField = function () { - return _.keys(this.customFields).length < 4; + return _.keys(this.card.customFields).length < 4; }; this.addCustomField = function () { @@ -111,7 +111,7 @@ this.card.customFields = {}; // Find the first 'available' custom field - var availableKeys = _.pullAll(['1', '2', '3', '4'], _.keys(this.customFields)); + var availableKeys = _.pullAll(['1', '2', '3', '4'], _.keys(this.card.customFields)); this.card.customFields[availableKeys[0]] = ""; };