Merge pull request #3048 from matrix-org/travis/fix-lowbandwidth-logout
Don't try and low encryption info when signing out in low bandwidth mode
This commit is contained in:
commit
f512f51f54
1 changed files with 14 additions and 11 deletions
|
@ -20,11 +20,12 @@ import sdk from '../../../index';
|
||||||
import dis from '../../../dispatcher';
|
import dis from '../../../dispatcher';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||||
|
import SettingsStore from "../../../settings/SettingsStore";
|
||||||
|
|
||||||
export default class LogoutDialog extends React.Component {
|
export default class LogoutDialog extends React.Component {
|
||||||
defaultProps = {
|
defaultProps = {
|
||||||
onFinished: function() {},
|
onFinished: function() {},
|
||||||
}
|
};
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
@ -34,9 +35,11 @@ export default class LogoutDialog extends React.Component {
|
||||||
this._onSetRecoveryMethodClick = this._onSetRecoveryMethodClick.bind(this);
|
this._onSetRecoveryMethodClick = this._onSetRecoveryMethodClick.bind(this);
|
||||||
this._onLogoutConfirm = this._onLogoutConfirm.bind(this);
|
this._onLogoutConfirm = this._onLogoutConfirm.bind(this);
|
||||||
|
|
||||||
const shouldLoadBackupStatus = !MatrixClientPeg.get().getKeyBackupEnabled();
|
const lowBandwidth = SettingsStore.getValue("lowBandwidth");
|
||||||
|
const shouldLoadBackupStatus = !lowBandwidth && !MatrixClientPeg.get().getKeyBackupEnabled();
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
|
shouldLoadBackupStatus: shouldLoadBackupStatus,
|
||||||
loading: shouldLoadBackupStatus,
|
loading: shouldLoadBackupStatus,
|
||||||
backupInfo: null,
|
backupInfo: null,
|
||||||
error: null,
|
error: null,
|
||||||
|
@ -110,6 +113,9 @@ export default class LogoutDialog extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
if (this.state.shouldLoadBackupStatus) {
|
||||||
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||||
|
|
||||||
const description = <div>
|
const description = <div>
|
||||||
<p>{_t(
|
<p>{_t(
|
||||||
"Encrypted messages are secured with end-to-end encryption. " +
|
"Encrypted messages are secured with end-to-end encryption. " +
|
||||||
|
@ -118,9 +124,6 @@ export default class LogoutDialog extends React.Component {
|
||||||
<p>{_t("Back up your keys before signing out to avoid losing them.")}</p>
|
<p>{_t("Back up your keys before signing out to avoid losing them.")}</p>
|
||||||
</div>;
|
</div>;
|
||||||
|
|
||||||
if (!MatrixClientPeg.get().getKeyBackupEnabled()) {
|
|
||||||
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
|
||||||
|
|
||||||
let dialogContent;
|
let dialogContent;
|
||||||
if (this.state.loading) {
|
if (this.state.loading) {
|
||||||
const Spinner = sdk.getComponent('views.elements.Spinner');
|
const Spinner = sdk.getComponent('views.elements.Spinner');
|
||||||
|
|
Loading…
Reference in a new issue