Merge pull request #3529 from matrix-org/t3chguy/react16_cleanup2

React error/warning cleanup
This commit is contained in:
Michael Telatynski 2019-10-09 16:26:24 +01:00 committed by GitHub
commit ff18a04da1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 63 additions and 86 deletions

View file

@ -146,19 +146,17 @@ module.exports = createReactClass({
});
},
componentWillMount: function() {
MatrixClientPeg.get().on("accountData", this.onAccountData);
MatrixClientPeg.get().on("Room.name", this.onRoomName);
componentDidMount: function() {
const cli = MatrixClientPeg.get();
cli.on("accountData", this.onAccountData);
cli.on("Room.name", this.onRoomName);
ActiveRoomObserver.addListener(this.props.room.roomId, this._onActiveRoomChange);
this.dispatcherRef = dis.register(this.onAction);
if (this._shouldShowStatusMessage()) {
const statusUser = this._getStatusMessageUser();
if (statusUser) {
statusUser.on(
"User._unstable_statusMessage",
this._onStatusMessageCommitted,
);
statusUser.on("User._unstable_statusMessage", this._onStatusMessageCommitted);
}
}
},