mirror of https://github.com/vector-im/riot-web
Make MemberInfo to use client.getStoredDevicesForUser
It's more powerful than listDeviceKeys, and isn't deprecated.pull/21833/head
parent
941dcc7e87
commit
fc40bdcbfc
|
@ -26,31 +26,31 @@ module.exports = React.createClass({
|
|||
|
||||
onVerifyClick: function() {
|
||||
MatrixClientPeg.get().setDeviceVerified(
|
||||
this.props.userId, this.props.device.id, true
|
||||
this.props.userId, this.props.device.deviceId, true
|
||||
);
|
||||
},
|
||||
|
||||
onUnverifyClick: function() {
|
||||
MatrixClientPeg.get().setDeviceVerified(
|
||||
this.props.userId, this.props.device.id, false
|
||||
this.props.userId, this.props.device.deviceId, false
|
||||
);
|
||||
},
|
||||
|
||||
onBlockClick: function() {
|
||||
MatrixClientPeg.get().setDeviceBlocked(
|
||||
this.props.userId, this.props.device.id, true
|
||||
this.props.userId, this.props.device.deviceId, true
|
||||
);
|
||||
},
|
||||
|
||||
onUnblockClick: function() {
|
||||
MatrixClientPeg.get().setDeviceBlocked(
|
||||
this.props.userId, this.props.device.id, false
|
||||
this.props.userId, this.props.device.deviceId, false
|
||||
);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var indicator = null, blockButton = null, verifyButton = null;
|
||||
if (this.props.device.blocked) {
|
||||
if (this.props.device.isBlocked()) {
|
||||
blockButton = (
|
||||
<div className="mx_MemberDeviceInfo_textButton mx_MemberDeviceInfo_unblock"
|
||||
onClick={this.onUnblockClick}>
|
||||
|
@ -66,7 +66,7 @@ module.exports = React.createClass({
|
|||
);
|
||||
}
|
||||
|
||||
if (this.props.device.verified) {
|
||||
if (this.props.device.isVerified()) {
|
||||
verifyButton = (
|
||||
<div className="mx_MemberDeviceInfo_textButton mx_MemberDeviceInfo_unverify"
|
||||
onClick={this.onUnverifyClick}>
|
||||
|
@ -82,22 +82,22 @@ module.exports = React.createClass({
|
|||
);
|
||||
}
|
||||
|
||||
if (this.props.device.blocked) {
|
||||
if (this.props.device.isBlocked()) {
|
||||
indicator = (
|
||||
<div className="mx_MemberDeviceInfo_blocked">✖</div>
|
||||
<div className="mx_MemberDeviceInfo_blocked">Blocked</div>
|
||||
);
|
||||
} else if (this.props.device.verified) {
|
||||
} else if (this.props.device.isVerified()) {
|
||||
indicator = (
|
||||
<div className="mx_MemberDeviceInfo_verified">✔</div>
|
||||
<div className="mx_MemberDeviceInfo_verified">Verified</div>
|
||||
);
|
||||
|
||||
} else {
|
||||
indicator = (
|
||||
<div className="mx_MemberDeviceInfo_unverified">?</div>
|
||||
<div className="mx_MemberDeviceInfo_unverified">Unverified</div>
|
||||
);
|
||||
}
|
||||
|
||||
var deviceName = this.props.device.display_name || this.props.device.id;
|
||||
var deviceName = this.props.device.display_name || this.props.device.deviceId;
|
||||
|
||||
return (
|
||||
<div className="mx_MemberDeviceInfo">
|
||||
|
|
|
@ -159,7 +159,7 @@ module.exports = React.createClass({
|
|||
if (userId == this.props.member.userId) {
|
||||
// no need to re-download the whole thing; just update our copy of
|
||||
// the list.
|
||||
var devices = MatrixClientPeg.get().listDeviceKeys(userId);
|
||||
var devices = MatrixClientPeg.get().getStoredDevicesForUser(userId);
|
||||
this.setState({devices: devices});
|
||||
}
|
||||
},
|
||||
|
@ -195,7 +195,7 @@ module.exports = React.createClass({
|
|||
// we got cancelled - presumably a different user now
|
||||
return;
|
||||
}
|
||||
var devices = client.listDeviceKeys(member.userId);
|
||||
var devices = client.getStoredDevicesForUser(member.userId);
|
||||
self.setState({devicesLoading: false, devices: devices});
|
||||
}, function(err) {
|
||||
console.log("Error downloading devices", err);
|
||||
|
|
Loading…
Reference in New Issue