summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2023-05-15 09:05:44 +0200
committerGitHub <noreply@github.com>2023-05-15 09:05:44 +0200
commit9410e7f189467baa8953e21ae3039a9df7a4d657 (patch)
tree9bc4ba8136133ff09a33edd24dcc33660a138e18
parent83daacf67327a0cef57ce142d337c6296b4555eb (diff)
parentc077554ed958050a3809aae9f352713092f57c42 (diff)
Merge pull request #3377 from nextcloud/fix/update-contact
Fix:Form is transitioned into view mode when saving fails
-rw-r--r--src/components/ContactDetails.vue12
-rw-r--r--src/store/contacts.js1
2 files changed, 9 insertions, 4 deletions
diff --git a/src/components/ContactDetails.vue b/src/components/ContactDetails.vue
index 1903d189..a125073a 100644
--- a/src/components/ContactDetails.vue
+++ b/src/components/ContactDetails.vue
@@ -313,8 +313,6 @@ import PropertySelect from './Properties/PropertySelect.vue'
export default {
name: 'ContactDetails',
- mixins: [isMobile],
-
components: {
ActionButton,
ActionLink,
@@ -341,6 +339,8 @@ export default {
NcButton,
},
+ mixins: [isMobile],
+
props: {
contactKey: {
type: String,
@@ -854,8 +854,12 @@ export default {
* Save the contact. This handler is triggered by the save button.
*/
async onSave() {
- await this.updateContact()
- this.editMode = false
+ try {
+ await this.updateContact()
+ this.editMode = false
+ } catch (error) {
+ showError(t('contacts', 'Unable to update contact'))
+ }
},
},
}
diff --git a/src/store/contacts.js b/src/store/contacts.js
index 58b1c7c5..2f296c09 100644
--- a/src/store/contacts.js
+++ b/src/store/contacts.js
@@ -380,6 +380,7 @@ const actions = {
context.commit('setContactAsConflict', { contact, etag: error.xhr.getResponseHeader('etag') })
console.error('This contact is outdated, the server refused it', contact)
}
+ throw (error)
}
} else {
console.error('This contact is outdated, refusing to push', contact)