Merge branch 'develop' into travis/react-warnings/3-componentCannotDidMount

This commit is contained in:
Travis Ralston 2020-04-01 11:14:19 -06:00 committed by GitHub
commit 07030a9466
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
102 changed files with 640 additions and 294 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

@ -23,6 +23,7 @@ import * as sdk from '../../../index';
import {MatrixClientPeg} from '../../../MatrixClientPeg';
import { _t } from '../../../languageHandler';
import Modal from '../../../Modal';
import {SSOAuthEntry} from "../auth/InteractiveAuthEntryComponents";
export default class DevicesPanel extends React.Component {
constructor(props) {
@ -123,11 +124,29 @@ export default class DevicesPanel extends React.Component {
// pop up an interactive auth dialog
const InteractiveAuthDialog = sdk.getComponent("dialogs.InteractiveAuthDialog");
const dialogAesthetics = {
[SSOAuthEntry.PHASE_PREAUTH]: {
title: _t("Use Single Sign On to continue"),
body: _t("Confirm deleting these sessions by using Single Sign On to prove your identity."),
continueText: _t("Single Sign On"),
continueKind: "primary",
},
[SSOAuthEntry.PHASE_POSTAUTH]: {
title: _t("Confirm deleting these sessions"),
body: _t("Click the button below to confirm deleting these sessions."),
continueText: _t("Delete sessions"),
continueKind: "danger",
},
};
Modal.createTrackedDialog('Delete Device Dialog', '', InteractiveAuthDialog, {
title: _t("Authentication"),
matrixClient: MatrixClientPeg.get(),
authData: error.data,
makeRequest: this._makeDeleteRequest.bind(this),
aestheticsForStagePhases: {
[SSOAuthEntry.LOGIN_TYPE]: dialogAesthetics,
[SSOAuthEntry.UNSTABLE_LOGIN_TYPE]: dialogAesthetics,
},
});
}).catch((e) => {
console.error("Error deleting sessions", e);

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();