From eeb01563f8b64974b8f75185db2c5c380da0380c Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 16 Sep 2016 02:26:09 +0100 Subject: [PATCH] add dialog keyboard shortcuts. download keys on demand --- .../views/dialogs/EncryptedEventDialog.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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