add dialog keyboard shortcuts. download keys on demand
parent
77595320a7
commit
eeb01563f8
|
@ -28,6 +28,13 @@ module.exports = React.createClass({
|
||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
var client = MatrixClientPeg.get();
|
var client = MatrixClientPeg.get();
|
||||||
client.on("deviceVerificationChanged", this.onDeviceVerificationChanged);
|
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() {
|
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() {
|
render: function() {
|
||||||
var event = this.props.event;
|
var event = this.props.event;
|
||||||
var device = this.state.device;
|
var device = this.state.device;
|
||||||
|
@ -63,7 +78,7 @@ module.exports = React.createClass({
|
||||||
var MemberDeviceInfo = sdk.getComponent('rooms.MemberDeviceInfo');
|
var MemberDeviceInfo = sdk.getComponent('rooms.MemberDeviceInfo');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_EncryptedEventDialog">
|
<div className="mx_EncryptedEventDialog" onKeyDown={ this.onKeyDown }>
|
||||||
<div className="mx_Dialog_title">
|
<div className="mx_Dialog_title">
|
||||||
End-to-end encryption information
|
End-to-end encryption information
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue