diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2019-03-10 20:18:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-10 20:18:14 +0100 |
commit | 7cefc8d04fe85f5fd39dddeef1842b4d85da4392 (patch) | |
tree | 6eeaf451ce548601180ef8d3287b17e1308f894e /src/components/ContactDetails.vue | |
parent | 7898d34a2b1240294764f8531d83734e063effbe (diff) | |
parent | 857cdebbeda28c05b8a527c57f79fedf404e8b30 (diff) |
Merge pull request #981 from nextcloud/fix/conflict
Fix/conflict
Diffstat (limited to 'src/components/ContactDetails.vue')
-rw-r--r-- | src/components/ContactDetails.vue | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/components/ContactDetails.vue b/src/components/ContactDetails.vue index c5f2bfd8..b740e0d5 100644 --- a/src/components/ContactDetails.vue +++ b/src/components/ContactDetails.vue @@ -77,7 +77,7 @@ content: conflict, show: true, trigger: 'manual', - }" class="header-icon header-icon--pulse icon-history-white" + }" class="header-icon header-icon--pulse icon-history-force-white" @click="refreshContact" /> <div class="menu-icon"> <div v-click-outside="closeMenu" class="header-icon icon-more-white" @click="toggleMenu" /> @@ -127,6 +127,7 @@ import debounce from 'debounce' import PQueue from 'p-queue' import rfcProps from 'Models/rfcProps' +import validate from 'Services/validate' import ContactProperty from './ContactDetails/ContactDetailsProperty' import AddNewProp from './ContactDetails/ContactDetailsAddNewProp' @@ -162,6 +163,8 @@ export default { data() { return { + // if true, the local contact have been fixed and requires a push + fixed: false, /** * Local off-store clone of the selected contact for edition * because we can't edit contacts data outside the store. @@ -368,6 +371,7 @@ export default { * Send the local clone of contact to the store */ async updateContact() { + this.fixed = false this.loadingUpdate = true await this.$store.dispatch('updateContact', this.localContact) this.loadingUpdate = false @@ -421,6 +425,9 @@ export default { Object.create(Object.getPrototypeOf(contact)), contact ) + + this.fixed = validate(localContact) + this.localContact = localContact this.loadingData = false } catch (error) { @@ -438,10 +445,14 @@ export default { } else { // create empty contact and copy inner data // wait for an update to really push the contact on the server! - this.localContact = Object.assign( + let localContact = Object.assign( Object.create(Object.getPrototypeOf(contact)), contact ) + + this.fixed = validate(localContact) + + this.localContact = localContact this.loadingData = false } |