{{ contact.displayName | firstLetter }}
+
{{ contact.email }}
-
@@ -42,6 +48,11 @@ export default {
required: true
}
},
+ data() {
+ return {
+ deleteTimeout: null
+ }
+ },
computed: {
selectedGroup() {
return this.$route.params.selectedGroup
@@ -72,6 +83,9 @@ export default {
}
},
avatarUrl() {
+ if (this.contact.photo) {
+ return `url(${this.contact.photo})`
+ }
return `url(${this.contact.url}?photo)`
}
},
@@ -89,8 +103,15 @@ export default {
* Dispatch contact deletion request
*/
deleteContact() {
- this.$store.dispatch('deleteContact', { contact: this.contact })
- this.$emit('deleted', this.index)
+ this.deleteTimeout = setTimeout(() => {
+ this.$store.dispatch('deleteContact', { contact: this.contact })
+ this.$emit('deleted', this.index)
+ }, 7000)
+ },
+
+ cancelDeletion() {
+ clearTimeout(this.deleteTimeout)
+ this.deleteTimeout = null
},
/**