Merge pull request #581 from matrix-org/dbkr/dont_crash_settings_if_no_e2e

Don't throw an exception entering settings page
pull/21833/head
Richard van der Hoff 2016-12-06 09:49:55 +00:00 committed by GitHub
commit c0b931a837
1 changed files with 3 additions and 5 deletions

View File

@ -338,17 +338,15 @@ module.exports = React.createClass({
}, },
_renderCryptoInfo: function() { _renderCryptoInfo: function() {
var client = MatrixClientPeg.get(); const client = MatrixClientPeg.get();
var deviceId = client.deviceId; const deviceId = client.deviceId;
var identityKey = client.getDeviceEd25519Key() || "<not supported>"; const identityKey = client.getDeviceEd25519Key() || "<not supported>";
var myDevice = client.getStoredDevicesForUser(MatrixClientPeg.get().credentials.userId)[0];
return ( return (
<div> <div>
<h3>Cryptography</h3> <h3>Cryptography</h3>
<div className="mx_UserSettings_section mx_UserSettings_cryptoSection"> <div className="mx_UserSettings_section mx_UserSettings_cryptoSection">
<ul> <ul>
<li><label>Device name:</label> <span>{ myDevice.getDisplayName() }</span></li>
<li><label>Device ID:</label> <span><code>{deviceId}</code></span></li> <li><label>Device ID:</label> <span><code>{deviceId}</code></span></li>
<li><label>Device key:</label> <span><code><b>{identityKey}</b></code></span></li> <li><label>Device key:</label> <span><code><b>{identityKey}</b></code></span></li>
</ul> </ul>