Don't throw an exception entering settings page

if end to end encryption is disabled (eg. if you're a guest and
the server is too old to support e2e for guests).
pull/21833/head
David Baker 2016-12-05 18:33:38 +00:00
parent 61cf08ca1b
commit 8ffe14881e
1 changed files with 10 additions and 1 deletions

View File

@ -338,7 +338,16 @@ module.exports = React.createClass({
},
_renderCryptoInfo: function() {
var client = MatrixClientPeg.get();
const client = MatrixClientPeg.get();
if (!client.isCryptoEnabled()) {
return <div>
<h3>Cryptography</h3>
<div className="mx_UserSettings_section mx_UserSettings_cryptoSection error">
End-to-end encryption is disabled
</div>
</div>;
}
var deviceId = client.deviceId;
var identityKey = client.getDeviceEd25519Key() || "<not supported>";