From c9d343725f159a897228e0396eb552a4bbceaf9e Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 6 Apr 2022 20:05:45 +0200 Subject: Only delete drafts that exist Signed-off-by: Christoph Wurst --- src/components/NewMessageModal.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/components/NewMessageModal.vue b/src/components/NewMessageModal.vue index 0135e5d15..e9961ed62 100644 --- a/src/components/NewMessageModal.vue +++ b/src/components/NewMessageModal.vue @@ -124,9 +124,11 @@ export default { await this.$store.dispatch('outbox/sendMessage', { id: message.id }) - // Remove old draft envelope - this.$store.commit('removeEnvelope', { id: data.draftId }) - this.$store.commit('removeMessage', { id: data.draftId }) + if (data.draftId) { + // Remove old draft envelope + this.$store.commit('removeEnvelope', { id: data.draftId }) + this.$store.commit('removeMessage', { id: data.draftId }) + } } }, recipientToRfc822(recipient) { -- cgit v1.2.3