diff --git a/src/components/views/dialogs/EncryptedEventDialog.js b/src/components/views/dialogs/EncryptedEventDialog.js index 149512bc40..46dfe5fc4f 100644 --- a/src/components/views/dialogs/EncryptedEventDialog.js +++ b/src/components/views/dialogs/EncryptedEventDialog.js @@ -28,6 +28,13 @@ module.exports = React.createClass({ componentWillMount: function() { var client = MatrixClientPeg.get(); client.on("deviceVerificationChanged", this.onDeviceVerificationChanged); + + client.downloadKeys([this.props.event.getSender()], true).done(()=>{ + var devices = client.getStoredDevicesForUser(this.props.event.getSender()); + this.setState({ device: this.refreshDevice() }); + }, (err)=>{ + console.log("Error downloading devices", err); + }); }, componentWillUnmount: function() { @@ -56,6 +63,14 @@ module.exports = React.createClass({ } }, + onKeyDown: function(e) { + if (e.keyCode === 27) { // escape + e.stopPropagation(); + e.preventDefault(); + this.props.onFinished(false); + } + }, + render: function() { var event = this.props.event; var device = this.state.device; @@ -63,7 +78,7 @@ module.exports = React.createClass({ var MemberDeviceInfo = sdk.getComponent('rooms.MemberDeviceInfo'); return ( -
+
End-to-end encryption information