React error/warning cleanup

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2019-10-08 12:10:37 +01:00
parent 15e7559d5b
commit a782baf510
10 changed files with 62 additions and 85 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);
}
}
},