diff options
Diffstat (limited to 'src/store/addressbooks.js')
-rw-r--r-- | src/store/addressbooks.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/store/addressbooks.js b/src/store/addressbooks.js index de2cb427..1dad9c28 100644 --- a/src/store/addressbooks.js +++ b/src/store/addressbooks.js @@ -192,8 +192,8 @@ const actions = { * @param {Object} context * @param {Object} importDetails = { vcf, addressbook } */ - getContactsFromAddressBook(context, { vcf, addressbook, importState }) { - let contacts = parseVcf(vcf, addressbook, importState) + getContactsFromAddressBook(context, { vcf, addressbook }) { + let contacts = parseVcf(vcf, addressbook) context.commit('appendContactsToAddressbook', { addressbook, contacts }) context.commit('appendContacts', contacts) context.commit('sortContacts') @@ -201,6 +201,20 @@ const actions = { }, /** + * + * @param {Object} context + * @param {Object} importDetails = { vcf, addressbook } + */ + importContactsIntoAddressbook(context, { vcf, addressbook }) { + let contacts = parseVcf(vcf, addressbook) + contacts.forEach(contact => { + context.commit('addContact', contact) + context.commit('addContactToAddressbook', contact) + context.commit('appendGroupsFromContacts', [contact]) + }) + }, + + /** * Remove sharee from Addressbook * @param {Object} context Current context * @param {Object} sharee Addressbook sharee object |