fix: Hide rich editor for unsupported channels (#2102)

* Fix: Hide rich editor for unsupported channels

* Review fixes

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Nithin David Thomas
2021-04-16 19:03:46 +05:30
committed by GitHub
parent 98bfef026e
commit c287ad08fb

View File

@@ -127,10 +127,18 @@ export default {
}, },
computed: { computed: {
showRichContentEditor() { showRichContentEditor() {
if (this.isOnPrivateNote) {
return true;
}
if (this.isRichEditorEnabled) {
const { const {
display_rich_content_editor: displayRichContentEditor, display_rich_content_editor: displayRichContentEditor,
} = this.uiSettings; } = this.uiSettings;
return this.isOnPrivateNote || displayRichContentEditor;
return displayRichContentEditor;
}
return false;
}, },
...mapGetters({ currentChat: 'getSelectedChat' }), ...mapGetters({ currentChat: 'getSelectedChat' }),
enterToSendEnabled() { enterToSendEnabled() {
@@ -219,9 +227,7 @@ export default {
return this.attachedFiles.length; return this.attachedFiles.length;
}, },
isRichEditorEnabled() { isRichEditorEnabled() {
return ( return this.isAWebWidgetInbox || this.isAnEmailChannel;
this.isAWebWidgetInbox || this.isAnEmailChannel || this.isOnPrivateNote
);
}, },
isOnPrivateNote() { isOnPrivateNote() {
return this.replyType === REPLY_EDITOR_MODES.NOTE; return this.replyType === REPLY_EDITOR_MODES.NOTE;