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.
This commit is contained in:
Simon Hauser
2021-11-25 19:17:33 +01:00
committed by GitHub
parent 841dc683b5
commit fc121acff3

View File

@@ -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]] = "";
};