From 38b8e93e10eeed0ee4d3078a96b8ac6eb984c5e1 Mon Sep 17 00:00:00 2001 From: krantheman Date: Tue, 26 Nov 2024 13:44:37 +0530 Subject: [PATCH] feat: update values on closing dialog --- frontend/src/components/Modals/SendMail.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Modals/SendMail.vue b/frontend/src/components/Modals/SendMail.vue index 9d89896e..a9376cd3 100644 --- a/frontend/src/components/Modals/SendMail.vue +++ b/frontend/src/components/Modals/SendMail.vue @@ -220,8 +220,12 @@ const mail = reactive({ ...emptyMail }) watch(show, () => { if (!show.value) { - mailID.value = null - Object.assign(mail, emptyMail) + if (mailID.value) { + if (isMailEmpty.value) deleteDraftMail.submit() + else updateDraftMail.submit() + mailID.value = null + Object.assign(mail, emptyMail) + } return }