From f4ca073b4ae316400b163492c1fcbbc992bbaf7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 11 Sep 2021 10:26:15 +0200 Subject: [PATCH] Don't auto replace if not enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/rooms/SendMessageComposer.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/SendMessageComposer.tsx b/src/components/views/rooms/SendMessageComposer.tsx index 0a33af30b9..b2fca33dfe 100644 --- a/src/components/views/rooms/SendMessageComposer.tsx +++ b/src/components/views/rooms/SendMessageComposer.tsx @@ -354,9 +354,11 @@ export default class SendMessageComposer extends React.Component { } // Replace emoticon at the end of the message - const caret = this.editorRef.current?.getCaret(); - const position = model.positionForOffset(caret.offset, caret.atNodeEnd); - this.editorRef.current?.replaceEmoticon(position, REGEX_EMOTICON); + if (SettingsStore.getValue('MessageComposerInput.autoReplaceEmoji')) { + const caret = this.editorRef.current?.getCaret(); + const position = model.positionForOffset(caret.offset, caret.atNodeEnd); + this.editorRef.current?.replaceEmoticon(position, REGEX_EMOTICON); + } const replyToEvent = this.props.replyToEvent; let shouldSend = true;