diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-02-05 20:39:45 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-02-05 20:39:45 +0100 |
commit | 9f11b8e7a43cf29c27b60c4595ce162b5e698ae4 (patch) | |
tree | 021b9cbfc093680cce5af7dd75dc0fdbd3a1a7f0 /js | |
parent | 28feb70c37832d2696da35e88695e95eb844d7b9 (diff) |
Fix duplicate groups
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'js')
-rw-r--r-- | js/models/contact_model.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/models/contact_model.js b/js/models/contact_model.js index ca31cb39..0bcd40a5 100644 --- a/js/models/contact_model.js +++ b/js/models/contact_model.js @@ -322,6 +322,13 @@ angular.module('contactsApp') property.value = property.value.split(','); } } + // Remove duplicate categories + var uniqueCategories = _.unique(property.value); + if(!angular.equals(uniqueCategories, property.value)) { + this.failedProps.push(prop); + property.value = uniqueCategories; + console.debug(this.uid()+': Categories duplicate: ' + uniqueCategories + property.value); + } break; } return property; |