diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-01 16:38:38 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-01 16:39:32 +0200 |
commit | 134527baa933af63400c285b362d9ed889abb001 (patch) | |
tree | ef6b492ff8af3be5e3e25b46edbd30417df3a06e | |
parent | 7a9b36783e22f6970a66c39f9c9b0de8d2860431 (diff) |
Cleaned up old etag methods and bump to beta1
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/models/contact.js | 3 | ||||
-rw-r--r-- | src/store/addressbooks.js | 2 | ||||
-rw-r--r-- | src/store/contacts.js | 6 |
5 files changed, 8 insertions, 7 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml index 26b63e9f..7aa27696 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -11,7 +11,7 @@ * 👥 **Sharing of Adressbooks!** You want to share your contacts with your friends or coworkers? No problem! * 🙈 **We’re not reinventing the wheel!** Based on the great and open SabreDAV library. </description> - <version>3.0.0-alpha1</version> + <version>3.0.0-beta1</version> <licence>AGPL</licence> <author>John Molakvoæ</author> <author>Jessica Greene</author> diff --git a/package.json b/package.json index cc6f877d..aa2a5041 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "contacts", "description": "A contacts app for Nextcloud. Easily sync contacts from various devices, share and edit them online.", - "version": "3.0.0", + "version": "3.0.0-beta1", "author": "John Molakvoæ <skjnldsv@protonmail.com>", "license": "agpl", "private": true, diff --git a/src/models/contact.js b/src/models/contact.js index f19ce260..4edaff42 100644 --- a/src/models/contact.js +++ b/src/models/contact.js @@ -30,10 +30,9 @@ export default class Contact { * * @param {string} vcard the vcard data as string with proper new lines * @param {object} addressbook the addressbook which the contat belongs to - * @param {string} [etag=''] the current etag of the contact * @memberof Contact */ - constructor(vcard, addressbook, etag = '') { + constructor(vcard, addressbook) { if (typeof vcard !== 'string' || vcard.length === 0) { throw new Error('Invalid vCard') } diff --git a/src/store/addressbooks.js b/src/store/addressbooks.js index 15287c9b..3c745c95 100644 --- a/src/store/addressbooks.js +++ b/src/store/addressbooks.js @@ -312,7 +312,7 @@ const actions = { // We don't want to lose the url information // so we need to parse one by one const contacts = response.map(item => { - let contact = new Contact(item.data, addressbook, item.etag) + let contact = new Contact(item.data, addressbook) Vue.set(contact, 'dav', item) return contact }) diff --git a/src/store/contacts.js b/src/store/contacts.js index a6511e5d..e2220e91 100644 --- a/src/store/contacts.js +++ b/src/store/contacts.js @@ -279,6 +279,8 @@ const actions = { .then((response) => { // wrong etag, we most likely have a conflict if (response.status === 412) { + // saving the new etag so that the user can manually + // trigger a fetchCompleteData without any further errors contact.conflict = response.xhr.getResponseHeader('etag') } else { // all clear, let's update the store @@ -297,7 +299,7 @@ const actions = { * @param {Object} context the store mutations * @param {Object} data destructuring object * @param {Contact} data.contact the contact to fetch - * @param {string} data.etag the contact etag + * @param {string} data.etag the contact etag to override in case of conflict * @returns {Promise} */ async fetchFullContact(context, { contact, etag = '' }) { @@ -306,7 +308,7 @@ const actions = { } return contact.dav.fetchCompleteData() .then((response) => { - let newContact = new Contact(contact.dav.data, contact.addressbook, contact.dav.etag) + let newContact = new Contact(contact.dav.data, contact.addressbook) context.commit('updateContact', newContact) }) .catch((error) => { throw error }) |