fix: Enable reply editor for API channels with templates (#12973)
This commit is contained in:
@@ -174,8 +174,8 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
showWhatsappTemplates() {
|
showWhatsappTemplates() {
|
||||||
// We support WhatsApp templates for API channels if someone updates templates manually via API
|
// We support templates for API channels if someone updates templates manually via API
|
||||||
// That's why we don't explicitly check for WhatsApp channel type here
|
// That's why we don't explicitly check for channel type here
|
||||||
const templates = this.$store.getters['inboxes/getWhatsAppTemplates'](
|
const templates = this.$store.getters['inboxes/getWhatsAppTemplates'](
|
||||||
this.inboxId
|
this.inboxId
|
||||||
);
|
);
|
||||||
@@ -185,13 +185,20 @@ export default {
|
|||||||
return this.isATwilioWhatsAppChannel && !this.isPrivate;
|
return this.isATwilioWhatsAppChannel && !this.isPrivate;
|
||||||
},
|
},
|
||||||
isPrivate() {
|
isPrivate() {
|
||||||
if (this.currentChat.can_reply || this.isAWhatsAppChannel) {
|
if (
|
||||||
|
this.currentChat.can_reply ||
|
||||||
|
this.isAWhatsAppChannel ||
|
||||||
|
this.isAPIInbox
|
||||||
|
) {
|
||||||
return this.isOnPrivateNote;
|
return this.isOnPrivateNote;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
isReplyRestricted() {
|
isReplyRestricted() {
|
||||||
return !this.currentChat?.can_reply && !this.isAWhatsAppChannel;
|
return (
|
||||||
|
!this.currentChat?.can_reply &&
|
||||||
|
!(this.isAWhatsAppChannel || this.isAPIInbox)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
inboxId() {
|
inboxId() {
|
||||||
return this.currentChat.inbox_id;
|
return this.currentChat.inbox_id;
|
||||||
@@ -447,7 +454,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canReply || this.isAWhatsAppChannel) {
|
if (canReply || this.isAWhatsAppChannel || this.isAPIInbox) {
|
||||||
this.replyType = REPLY_EDITOR_MODES.REPLY;
|
this.replyType = REPLY_EDITOR_MODES.REPLY;
|
||||||
} else {
|
} else {
|
||||||
this.replyType = REPLY_EDITOR_MODES.NOTE;
|
this.replyType = REPLY_EDITOR_MODES.NOTE;
|
||||||
@@ -866,7 +873,8 @@ export default {
|
|||||||
this.$store.dispatch('draftMessages/setReplyEditorMode', {
|
this.$store.dispatch('draftMessages/setReplyEditorMode', {
|
||||||
mode,
|
mode,
|
||||||
});
|
});
|
||||||
if (canReply || this.isAWhatsAppChannel) this.replyType = mode;
|
if (canReply || this.isAWhatsAppChannel || this.isAPIInbox)
|
||||||
|
this.replyType = mode;
|
||||||
if (this.showRichContentEditor) {
|
if (this.showRichContentEditor) {
|
||||||
if (this.isRecordingAudio) {
|
if (this.isRecordingAudio) {
|
||||||
this.toggleAudioRecorder();
|
this.toggleAudioRecorder();
|
||||||
|
|||||||
Reference in New Issue
Block a user