diff --git a/src/components/views/dialogs/UnknownDeviceDialog.js b/src/components/views/dialogs/UnknownDeviceDialog.js index bb50da71a5..de69fd1c9d 100644 --- a/src/components/views/dialogs/UnknownDeviceDialog.js +++ b/src/components/views/dialogs/UnknownDeviceDialog.js @@ -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 (