Merge branch 'matthew/warn-unknown-devices' of github.com:matrix-org/matrix-react-sdk into matthew/warn-unknown-devices

pull/21833/head
Richard van der Hoff 2017-01-25 23:17:57 +00:00
commit 60d7575146
1 changed files with 11 additions and 0 deletions

View File

@ -16,6 +16,7 @@ limitations under the License.
import React from 'react';
import sdk from '../../../index';
import MatrixClientPeg from '../../../MatrixClientPeg';
function UserUnknownDeviceList(props) {
const {userDevices} = props;
@ -63,6 +64,16 @@ export default React.createClass({
onFinished: React.PropTypes.func.isRequired,
},
componentDidMount: function() {
// Given we've now shown the user the unknown device, it is no longer
// unknown to them. Therefore mark it as 'known'.
Object.keys(this.props.devices).forEach((userId) => {
Object.keys(this.props.devices[userId]).map((deviceId) => {
MatrixClientPeg.get().setDeviceKnown(userId, deviceId, true);
});
});
},
render: function() {
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
return (