From e97e68b1ba65f89964c26664ccb1242f0dc2547e Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Fri, 7 Feb 2025 16:28:27 +0530 Subject: [PATCH] fix: Message signature is not appending (#10855) # Pull Request Template ## Description **Issue:** The message signature wasn't being appended to new email conversations when a target inbox was selected. **Solution:** To address this, a reusable `handleSignatureSetup` function was created to manage the signature logic. The same logic was applied in both cases, when the inbox selection changed (using `watch`) and during the initial load (using `mounted`). Fixes https://linear.app/chatwoot/issue/CW-4005/allow-to-activate-the-message-signature-for-new-email-conversations-by https://github.com/chatwoot/chatwoot/issues/10836 ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? **Steps to reproduce**: https://github.com/chatwoot/chatwoot/issues/10836#issuecomment-2637354304 ### Loom video **Before** https://www.loom.com/share/ccf597cfa8d94d0eaff1222102901d2c?sid=abfea42b-425e-446e-8e92-99359b786607 **After** https://www.loom.com/share/d9deddfcf8de48ab87e31911dfb774d8?sid=c1aac19b-b243-428e-9a9f-2ad9f4efe49c ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --- .../NewConversation/components/ActionButtons.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue b/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue index 4df1e87be..244ce0653 100644 --- a/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue +++ b/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue @@ -77,7 +77,7 @@ const toggleMessageSignature = () => { setSignature(); }; -// Added this watch to dynamically set signature. +// Added this watch to dynamically set signature on target inbox change. // Only targetInbox has value and is Advance Editor(used by isEmailOrWebWidgetInbox) // Set the signature only if the inbox based flag is true watch( @@ -86,7 +86,8 @@ watch( nextTick(() => { if (newValue && props.isEmailOrWebWidgetInbox) setSignature(); }); - } + }, + { immediate: true } ); const onClickInsertEmoji = emoji => {