Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 60d7575

Browse files
committed
Merge branch 'matthew/warn-unknown-devices' of github.com:matrix-org/matrix-react-sdk into matthew/warn-unknown-devices
2 parents 70190be + ebf6ba8 commit 60d7575

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/components/views/dialogs/UnknownDeviceDialog.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616

1717
import React from 'react';
1818
import sdk from '../../../index';
19+
import MatrixClientPeg from '../../../MatrixClientPeg';
1920

2021
function UserUnknownDeviceList(props) {
2122
const {userDevices} = props;
@@ -63,6 +64,16 @@ export default React.createClass({
6364
onFinished: React.PropTypes.func.isRequired,
6465
},
6566

67+
componentDidMount: function() {
68+
// Given we've now shown the user the unknown device, it is no longer
69+
// unknown to them. Therefore mark it as 'known'.
70+
Object.keys(this.props.devices).forEach((userId) => {
71+
Object.keys(this.props.devices[userId]).map((deviceId) => {
72+
MatrixClientPeg.get().setDeviceKnown(userId, deviceId, true);
73+
});
74+
});
75+
},
76+
6677
render: function() {
6778
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
6879
return (

0 commit comments

Comments
 (0)