Merge branch 'develop' into travis/soft-logout-design

This commit is contained in:
Travis Ralston 2019-07-09 11:35:49 -06:00
commit 4b1d78e04d
23 changed files with 511 additions and 95 deletions

View file

@ -52,7 +52,7 @@ export default class SoftLogout extends React.Component {
const hsUrl = MatrixClientPeg.get().getHomeserverUrl();
const domainName = hsUrl === defaultServerConfig.hsUrl
? defaultServerConfig.hsName
: MatrixClientPeg.get().getHomeServerName();
: MatrixClientPeg.getHomeserverName();
const userId = MatrixClientPeg.get().getUserId();
const user = MatrixClientPeg.get().getUser(userId);
@ -66,13 +66,20 @@ export default class SoftLogout extends React.Component {
userId,
displayName,
loginView: LOGIN_VIEW.LOADING,
keyBackupNeeded: true, // assume we do while we figure it out (see componentWillMount)
busy: false,
password: "",
errorText: "",
};
}
componentDidMount(): void {
this._initLogin();
MatrixClientPeg.get().flagAllGroupSessionsForBackup().then(remaining => {
this.setState({keyBackupNeeded: remaining > 0});
});
}
onClearAll = () => {
@ -160,9 +167,16 @@ export default class SoftLogout extends React.Component {
error = <span className='mx_Login_error'>{this.state.errorText}</span>;
}
let introText = _t("Enter your password to sign in and regain access to your account.");
if (this.state.keyBackupNeeded) {
introText = _t(
"Regain access your account and recover encryption keys stored on this device. " +
"Without them, you wont be able to read all of your secure messages on any device.");
}
return (
<form onSubmit={this.onPasswordLogin}>
<p>{_t("Enter your password to sign in and regain access to your account.")}</p>
<p>{introText}</p>
{error}
<Field
id="softlogout_password"