From 55b4ef2169e8640417084deff0197f8ede95e3ea Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 5 Jul 2019 13:52:14 -0600 Subject: [PATCH] Change soft logout rehydrate text if there's pending key backups Fixes https://github.com/vector-im/riot-web/issues/10263 Requires https://github.com/matrix-org/matrix-js-sdk/pull/982 --- src/components/structures/auth/SoftLogout.js | 16 +++++++++++++++- src/i18n/strings/en_EN.json | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/structures/auth/SoftLogout.js b/src/components/structures/auth/SoftLogout.js index e01be3c1f0..475ed1108a 100644 --- a/src/components/structures/auth/SoftLogout.js +++ b/src/components/structures/auth/SoftLogout.js @@ -64,6 +64,7 @@ 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: "", @@ -73,6 +74,12 @@ export default class SoftLogout extends React.Component { this._initLogin(); } + componentWillMount(): void { + MatrixClientPeg.get().flagAllGroupSessionsForBackup().then(remaining => { + this.setState({keyBackupNeeded: remaining > 0}); + }); + } + onClearAll = () => { const ConfirmWipeDeviceDialog = sdk.getComponent('dialogs.ConfirmWipeDeviceDialog'); Modal.createTrackedDialog('Clear Data', 'Soft Logout', ConfirmWipeDeviceDialog, { @@ -158,9 +165,16 @@ export default class SoftLogout extends React.Component { error = {this.state.errorText}; } + 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 won’t be able to read all of your secure messages on any device."); + } + return (
-

{_t("Enter your password to sign in and regain access to your account.")}

+

{introText}

{error} log in to your new account.": "You can now close this window or log in to your new account.", "Registration Successful": "Registration Successful", "Create your account": "Create your account", + "Failed to re-authenticate due to a homeserver problem": "Failed to re-authenticate due to a homeserver problem", "Failed to re-authenticate": "Failed to re-authenticate", "Enter your password to sign in and regain access to your account.": "Enter your password to sign in and regain access to your account.", + "Regain access your account and recover encryption keys stored on this device. Without them, you won’t be able to read all of your secure messages on any device.": "Regain access your account and recover encryption keys stored on this device. Without them, you won’t be able to read all of your secure messages on any device.", "Forgotten your password?": "Forgotten your password?", "Cannot re-authenticate with your account. Please contact your homeserver admin for more information.": "Cannot re-authenticate with your account. Please contact your homeserver admin for more information.", "You're signed out": "You're signed out",