summaryrefslogtreecommitdiffstats
path: root/src/models
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-12-19 09:33:56 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-12-19 09:35:56 +0100
commit14f9b4c57e7cdaf1dc7b75361796b4db3203a129 (patch)
treeb8f68af5f2c86f36a40393956ea5588101d50686 /src/models
parent43f7abc1e41037c71fd3d3faa389697314d3e853 (diff)
Fix groups addition and new contact instertion into groups
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/models')
-rw-r--r--src/models/contact.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/models/contact.js b/src/models/contact.js
index b9185d53..2f877d2e 100644
--- a/src/models/contact.js
+++ b/src/models/contact.js
@@ -179,7 +179,14 @@ export default class Contact {
*/
set groups(groups) {
if (Array.isArray(groups)) {
- this.vCard.updatePropertyWithValue('uid', groups)
+ let property = this.vCard.getFirstProperty('categories')
+ if (!property) {
+ // Init with empty group since we set everything afterwise
+ property = this.vCard.addPropertyWithValue('categories', '')
+ }
+ property.setValues(groups)
+ } else {
+ throw new Error('groups data is not an Array')
}
}