s/DidMount/WillMount/ in MessageComposerInput

This fixes the tests that broke with https://github.com/matrix-org/matrix-js-sdk/pull/717

This is because of https://github.com/vector-im/riot-web/blob/master/test/app-tests/joining.js#L63
which prevents the DOM nodes from actually ending up in the DOM, even though the react components
get rendered. This means that WillMount and WillUnmount are called, but not DidMount.

Using WillMount is more symmertrical anyway since the resulting teardown code must be in
WillUnmount (since there is no DidUnmount).
This commit is contained in:
David Baker 2018-09-06 11:44:13 +01:00
parent 9f5ea73dc2
commit 9e64a22884

View File

@ -336,7 +336,7 @@ export default class MessageComposerInput extends React.Component {
}
}
componentDidMount() {
componentWillMount() {
this.dispatcherRef = dis.register(this.onAction);
this.historyManager = new ComposerHistoryManager(this.props.room.roomId, 'mx_slate_composer_history_');
}