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:
parent
1616431d27
commit
7ce49c752f
3 changed files with 45 additions and 3 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue