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

@ -139,6 +139,7 @@ module.exports = React.createClass({
componentDidMount: function() {
this._suppressReadReceiptAnimation = false;
this.dispatcherRef = dispatcher.register(this.onAction);
},
componentWillReceiveProps: function (nextProps) {
@ -159,6 +160,20 @@ module.exports = React.createClass({
return false;
},
componentWillUnmount: function() {
dispatcher.unregister(this.dispatcherRef);
},
onAction: function(payload) {
switch (payload.action) {
case 'device_verified':
if (payload.params.userId == this.props.mxEvent.getSender()) {
this._verifyEvent(this.props.mxEvent);
}
break;
}
},
_verifyEvent: function(mxEvent) {
var verified = null;