Merge pull request #4313 from matrix-org/travis/react-warnings/1-componentDidMount

Use componentDidMount in place of componentWillMount where possible
This commit is contained in:
Travis Ralston 2020-04-01 11:13:04 -06:00 committed by GitHub
commit 59a99bbad8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 81 additions and 91 deletions

View file

@ -55,7 +55,7 @@ export default createReactClass({
};
},
componentWillMount: function() {
componentDidMount: function() {
MatrixClientPeg.get().on("RoomState.events", this.onRoomStateEvents);
},

View file

@ -78,7 +78,7 @@ export default createReactClass({
};
},
componentWillMount: function() {
componentDidMount: function() {
this._sessionStore = sessionStore;
this._sessionStoreToken = this._sessionStore.addListener(
this._setStateFromSessionStore,

View file

@ -63,7 +63,7 @@ export default class EventIndexPanel extends React.Component {
}
}
async componentWillMount(): void {
async componentDidMount(): void {
this.updateState();
}

View file

@ -38,7 +38,7 @@ export default class KeyBackupPanel extends React.PureComponent {
};
}
componentWillMount() {
componentDidMount() {
this._checkKeyBackupStatus();
MatrixClientPeg.get().on('crypto.keyBackupStatus', this._onKeyBackupStatus);

View file

@ -87,7 +87,7 @@ export default createReactClass({
};
},
componentWillMount: function() {
componentDidMount: function() {
this._refreshFromServer();
},

View file

@ -40,7 +40,7 @@ export default class HelpUserSettingsTab extends React.Component {
};
}
componentWillMount(): void {
componentDidMount(): void {
PlatformPeg.get().getAppVersion().then((ver) => this.setState({vectorVersion: ver})).catch((e) => {
console.error("Error getting vector version: ", e);
});

View file

@ -81,7 +81,7 @@ export default class PreferencesUserSettingsTab extends React.Component {
};
}
async componentWillMount(): void {
async componentDidMount(): void {
const platform = PlatformPeg.get();
const autoLaunchSupported = await platform.supportsAutoLaunch();