From 4627aad56d10792fb25c2465292a989c82ca4726 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Mon, 1 Dec 2025 10:13:38 +0530 Subject: [PATCH] fix: Enable reply editor for API channels with templates (#12973) --- .../widgets/conversation/ReplyBox.vue | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue index c74dcecea..0c08b9bd3 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue @@ -174,8 +174,8 @@ export default { return false; }, showWhatsappTemplates() { - // We support WhatsApp templates for API channels if someone updates templates manually via API - // That's why we don't explicitly check for WhatsApp channel type here + // We support templates for API channels if someone updates templates manually via API + // That's why we don't explicitly check for channel type here const templates = this.$store.getters['inboxes/getWhatsAppTemplates']( this.inboxId ); @@ -185,13 +185,20 @@ export default { return this.isATwilioWhatsAppChannel && !this.isPrivate; }, isPrivate() { - if (this.currentChat.can_reply || this.isAWhatsAppChannel) { + if ( + this.currentChat.can_reply || + this.isAWhatsAppChannel || + this.isAPIInbox + ) { return this.isOnPrivateNote; } return true; }, isReplyRestricted() { - return !this.currentChat?.can_reply && !this.isAWhatsAppChannel; + return ( + !this.currentChat?.can_reply && + !(this.isAWhatsAppChannel || this.isAPIInbox) + ); }, inboxId() { return this.currentChat.inbox_id; @@ -447,7 +454,7 @@ export default { return; } - if (canReply || this.isAWhatsAppChannel) { + if (canReply || this.isAWhatsAppChannel || this.isAPIInbox) { this.replyType = REPLY_EDITOR_MODES.REPLY; } else { this.replyType = REPLY_EDITOR_MODES.NOTE; @@ -866,7 +873,8 @@ export default { this.$store.dispatch('draftMessages/setReplyEditorMode', { mode, }); - if (canReply || this.isAWhatsAppChannel) this.replyType = mode; + if (canReply || this.isAWhatsAppChannel || this.isAPIInbox) + this.replyType = mode; if (this.showRichContentEditor) { if (this.isRecordingAudio) { this.toggleAudioRecorder();