From 3ee525ef1fbfac0d04bbf5f8c7069850c45e4236 Mon Sep 17 00:00:00 2001 From: jedi Date: Tue, 5 Nov 2024 23:32:53 +0100 Subject: [PATCH] use an 'AsyncButton' that waits for completion of an async onClick handler for mail replies and comments in tickets --- web/src/components/Timeline.vue | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/web/src/components/Timeline.vue b/web/src/components/Timeline.vue index 2cf8b97..88bfa94 100644 --- a/web/src/components/Timeline.vue +++ b/web/src/components/Timeline.vue @@ -104,18 +104,15 @@ export default { }, }, methods: { - ...mapActions(['fetchShippingVouchers']), - sendMailAndClear: function () { - this.$emit('sendMail', this.newMail); + ...mapActions(['sendMail', 'postComment']), + sendMailAndClear: async function () { + await this.sendMail(this.newMail); this.newMail = ""; }, - addCommentAndClear: function () { - this.$emit('addComment', this.newComment); + addCommentAndClear: async function () { + await this.postComment(this.newComment); this.newComment = ""; } - }, - mounted() { - this.fetchShippingVouchers(); } };