Wire up events to update UI on device verification

Use the dispatcher to update event tiles and memberdeviceinfo when a device is
marked as verified.
This commit is contained in:
Richard van der Hoff 2016-06-08 18:35:43 +01:00
parent 1616431d27
commit 7ce49c752f
3 changed files with 45 additions and 3 deletions

View file

@ -17,6 +17,8 @@ limitations under the License.
var React = require('react');
var MatrixClientPeg = require("../../../MatrixClientPeg");
var dis = require("../../../dispatcher");
module.exports = React.createClass({
displayName: 'MemberDeviceInfo',
propTypes: {
@ -27,9 +29,14 @@ module.exports = React.createClass({
onVerifyClick: function() {
MatrixClientPeg.get().setDeviceVerified(this.props.userId,
this.props.device.id);
// TODO: wire this up properly
this.props.device.verified = true;
this.forceUpdate();
dis.dispatch({
action: 'device_verified',
params: {
userId: this.props.userId,
deviceId: this.props.device.id,
},
});
},
render: function() {