summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kraus <hanzi@hanzi.cc>2020-01-18 00:11:16 +0100
committerChristian Kraus <hanzi@hanzi.cc>2020-01-18 00:11:16 +0100
commit8fadc6add639e1bfad6d49368c8f2300908de2de (patch)
treeb6947d37aa69a4cd46ec5746ce98e85301534a6c
parenta38a728a8ce3a97b24248af40b2e3d3edb60620c (diff)
Prevent bogus updates of selected contact
Before, when creating a new contact the previously selected contact would still be the 'localContact'. That happened because the 'contact' watcher would be called twice (once with the new, once with the old contact). Adding a check whether the selected contact has actually changed remedies that. Signed-off-by: Christian Kraus <hanzi@hanzi.cc>
-rw-r--r--src/components/ContactDetails.vue4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/ContactDetails.vue b/src/components/ContactDetails.vue
index 1bdcaf16..5ce82a86 100644
--- a/src/components/ContactDetails.vue
+++ b/src/components/ContactDetails.vue
@@ -401,8 +401,8 @@ export default {
},
watch: {
- contact: function() {
- if (this.contactKey) {
+ contact: function(newContact, oldContact) {
+ if (this.contactKey && newContact !== oldContact) {
this.selectContact(this.contactKey)
}
},