diff --git a/src/components/views/dialogs/UnknownDeviceDialog.js b/src/components/views/dialogs/UnknownDeviceDialog.js index 22a7112c01..ff2accf0b0 100644 --- a/src/components/views/dialogs/UnknownDeviceDialog.js +++ b/src/components/views/dialogs/UnknownDeviceDialog.js @@ -97,6 +97,8 @@ export default React.createClass({ }, componentWillMount: function() { + this._unmounted = false; + const roomMembers = this.props.room.getJoinedMembers().map((m) => { return m.userId; }); @@ -106,6 +108,8 @@ export default React.createClass({ devices: null, }); MatrixClientPeg.get().downloadKeys(roomMembers, false).then((devices) => { + if (this._unmounted) return; + const unknownDevices = {}; // This is all devices in this room, so find the unknown ones. Object.keys(devices).forEach((userId) => { @@ -133,6 +137,10 @@ export default React.createClass({ }); }, + componentWillUnmount: function() { + this._unmounted = true; + }, + render: function() { if (this.state.devices === null) { const Spinner = sdk.getComponent("elements.Spinner");