From fe0b0f59c8412fe61d3b6b3d7b718a1cca5fa81a Mon Sep 17 00:00:00 2001 From: N-Pex Date: Tue, 29 Oct 2024 11:58:50 +0100 Subject: [PATCH] Reset send information and better state check before cancel. --- src/components/Chat.vue | 4 +++- src/components/sendAttachmentsMixin.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Chat.vue b/src/components/Chat.vue index 5efd010..4d9202d 100644 --- a/src/components/Chat.vue +++ b/src/components/Chat.vue @@ -1573,7 +1573,9 @@ export default { cancelSendAttachment() { this.$refs.attachment.value = null; - this.cancelSendAttachments(); + if (this.sendingStatus != this.sendStatuses.INITIAL) { + this.cancelSendAttachments(); + } this.currentFileInputs = null; this.attachmentCaption = undefined; this.currentSendError = null; diff --git a/src/components/sendAttachmentsMixin.js b/src/components/sendAttachmentsMixin.js index 395b1f6..78a3893 100644 --- a/src/components/sendAttachmentsMixin.js +++ b/src/components/sendAttachmentsMixin.js @@ -123,6 +123,8 @@ export default { }) .then(() => { this.sendingStatus = this.sendStatuses.SENT; + this.sendingAttachments = []; + this.sendingRootEventId = null; }) .catch((err) => { console.error("ERROR", err);