diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-27 10:43:36 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-27 10:43:38 +0100 |
commit | 7d899726fd0bd14134dc2f936eb518e8f398c745 (patch) | |
tree | b517baafc66161b1988600654b1f8a167372e0ca /src | |
parent | 0f37c3d40998b8ebd07fc83c784bf91594d4623b (diff) |
Do not validate on init
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/store/addressbooks.js | 4 | ||||
-rw-r--r-- | src/store/contacts.js | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/store/addressbooks.js b/src/store/addressbooks.js index 264735f3..85e23379 100644 --- a/src/store/addressbooks.js +++ b/src/store/addressbooks.js @@ -29,7 +29,6 @@ import Contact from 'Models/contact' import client from 'Services/cdav' import parseVcf from 'Services/parseVcf' -import validate from 'Services/validate' const addressbookModel = { id: '', @@ -403,9 +402,6 @@ const actions = { // create the array of requests to send contacts.map(async contact => { - // validate and repair if needed - validate(contact) - // Get vcard string try { let vData = ICAL.stringify(contact.vCard.jCal) diff --git a/src/store/contacts.js b/src/store/contacts.js index 5018cdd4..2cd9581f 100644 --- a/src/store/contacts.js +++ b/src/store/contacts.js @@ -53,7 +53,8 @@ const state = { const mutations = { /** - * Store contacts into state + * Store raw contacts into state + * Used by the first contact fetch * * @param {Object} state Default state * @param {Array<Contact>} contacts Contacts @@ -61,10 +62,9 @@ const mutations = { appendContacts(state, contacts = []) { state.contacts = contacts.reduce(function(list, contact) { if (contact instanceof Contact) { - validate(contact) Vue.set(list, contact.key, contact) } else { - console.error('Wrong contact object', contact) + console.error('Invalid contact object', contact) } return list }, state.contacts) @@ -97,7 +97,7 @@ const mutations = { addContact(state, contact) { if (contact instanceof Contact) { - // Checking contact validity 🙈 + // Checking contact validity 🔍🙈 validate(contact) let sortedContact = { |