From c287ad08fbb79ce4cfce88fd2c2a034a8ee63322 Mon Sep 17 00:00:00 2001 From: Nithin David Thomas Date: Fri, 16 Apr 2021 19:03:46 +0530 Subject: [PATCH] fix: Hide rich editor for unsupported channels (#2102) * Fix: Hide rich editor for unsupported channels * Review fixes Co-authored-by: Muhsin Keloth --- .../widgets/conversation/ReplyBox.vue | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue index 0aeb9edcd..ae3ba444a 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue @@ -127,10 +127,18 @@ export default { }, computed: { showRichContentEditor() { - const { - display_rich_content_editor: displayRichContentEditor, - } = this.uiSettings; - return this.isOnPrivateNote || displayRichContentEditor; + if (this.isOnPrivateNote) { + return true; + } + + if (this.isRichEditorEnabled) { + const { + display_rich_content_editor: displayRichContentEditor, + } = this.uiSettings; + + return displayRichContentEditor; + } + return false; }, ...mapGetters({ currentChat: 'getSelectedChat' }), enterToSendEnabled() { @@ -219,9 +227,7 @@ export default { return this.attachedFiles.length; }, isRichEditorEnabled() { - return ( - this.isAWebWidgetInbox || this.isAnEmailChannel || this.isOnPrivateNote - ); + return this.isAWebWidgetInbox || this.isAnEmailChannel; }, isOnPrivateNote() { return this.replyType === REPLY_EDITOR_MODES.NOTE;