You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-20 16:22:28 +03:00
Merge pull request #2682 from jryans/simplify-composer-state-change
Remove duplicated conversion from `enableRichText`
This commit is contained in:
@@ -685,17 +685,14 @@ export default class MessageComposerInput extends React.Component {
|
||||
enableRichtext(enabled: boolean) {
|
||||
if (enabled === this.state.isRichTextEnabled) return;
|
||||
|
||||
let editorState = null;
|
||||
if (enabled) {
|
||||
editorState = this.mdToRichEditorState(this.state.editorState);
|
||||
} else {
|
||||
editorState = this.richToMdEditorState(this.state.editorState);
|
||||
}
|
||||
|
||||
Analytics.setRichtextMode(enabled);
|
||||
|
||||
this.setState({
|
||||
editorState: this.createEditorState(enabled, editorState),
|
||||
editorState: this.createEditorState(
|
||||
enabled,
|
||||
this.state.editorState,
|
||||
this.state.isRichTextEnabled,
|
||||
),
|
||||
isRichTextEnabled: enabled,
|
||||
}, () => {
|
||||
this._editor.focus();
|
||||
|
||||
Reference in New Issue
Block a user