diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-09-27 15:39:12 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-09-27 15:39:12 +0200 |
commit | 5501624f8f45c9427c1942c8674df7a38ed516cd (patch) | |
tree | 3a754359117c269c955ace8caec4fe96f6f7a480 /src/services | |
parent | cf8ff271a418055ddd83e9859cd0e64bd454535d (diff) |
Fix import and push vCards to the server
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/services')
-rw-r--r-- | src/services/parseVcf.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/services/parseVcf.js b/src/services/parseVcf.js index 65d5f95c..11b1fc49 100644 --- a/src/services/parseVcf.js +++ b/src/services/parseVcf.js @@ -26,14 +26,13 @@ import Store from '../store/index' export default function parseVcf(data = '', addressbook) { let regexp = /BEGIN:VCARD[\s\S]*?END:VCARD/mgi let vCards = data.match(regexp) - let importState = Store.getters.getImportState if (!vCards) { console.debug('Error during the parsing of the following vcf file: ', data) return [] } - importState.total = vCards.length + Store.dispatch('setTotal', vCards.length) // Not using map because we want to only push valid contacts // map force to return at least undefined @@ -41,11 +40,10 @@ export default function parseVcf(data = '', addressbook) { try { // console.log(vCards.indexOf(vCard)) let contact = new Contact(vCard, addressbook) - importState.accepted++ contacts.push(contact) } catch (e) { // Parse error! Do not stop here... - importState.denied++ + Store.dispatch('incrementDenied') console.error(e) } return contacts |