From 74186740eef3db4cc6063e9610cf38caa7ecfc8b Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 2 Apr 2020 11:30:43 +0100 Subject: [PATCH] Fix the edit messager composer Broken in https://github.com/matrix-org/matrix-react-sdk/pull/4313 Fixes https://github.com/vector-im/riot-web/issues/13001 --- src/components/views/rooms/EditMessageComposer.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/views/rooms/EditMessageComposer.js b/src/components/views/rooms/EditMessageComposer.js index d6ea0ec5f0..8353940c90 100644 --- a/src/components/views/rooms/EditMessageComposer.js +++ b/src/components/views/rooms/EditMessageComposer.js @@ -107,14 +107,15 @@ export default class EditMessageComposer extends React.Component { static contextType = MatrixClientContext; - constructor(props) { - super(props); + constructor(props, context) { + super(props, context); this.model = null; this._editorRef = null; this.state = { saveDisabled: true, }; + this._createEditorModel(); } _setEditorRef = ref => { @@ -223,10 +224,6 @@ export default class EditMessageComposer extends React.Component { this.props.editState.setEditorState(caret, parts); } - componentDidMount() { - this._createEditorModel(); - } - _createEditorModel() { const {editState} = this.props; const room = this._getRoom();