Don't auto replace if not enabled

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-09-11 10:26:15 +02:00
parent fd022310b3
commit f4ca073b4a
No known key found for this signature in database
GPG key ID: 55C211A1226CB17D

View file

@ -354,9 +354,11 @@ export default class SendMessageComposer extends React.Component<IProps> {
} }
// Replace emoticon at the end of the message // Replace emoticon at the end of the message
const caret = this.editorRef.current?.getCaret(); if (SettingsStore.getValue('MessageComposerInput.autoReplaceEmoji')) {
const position = model.positionForOffset(caret.offset, caret.atNodeEnd); const caret = this.editorRef.current?.getCaret();
this.editorRef.current?.replaceEmoticon(position, REGEX_EMOTICON); const position = model.positionForOffset(caret.offset, caret.atNodeEnd);
this.editorRef.current?.replaceEmoticon(position, REGEX_EMOTICON);
}
const replyToEvent = this.props.replyToEvent; const replyToEvent = this.props.replyToEvent;
let shouldSend = true; let shouldSend = true;