You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
MemberInfo: initialise _enableDevices in componentWillMount
... to avoid referencing it in render() before it is set
This commit is contained in:
@@ -67,17 +67,17 @@ module.exports = React.createClass({
|
|||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
this._cancelDeviceList = null;
|
this._cancelDeviceList = null;
|
||||||
|
|
||||||
|
// only display the devices list if our client supports E2E *and* the
|
||||||
|
// feature is enabled in the user settings
|
||||||
|
this._enableDevices = MatrixClientPeg.get().isCryptoEnabled() &&
|
||||||
|
UserSettingsStore.isFeatureEnabled("e2e_encryption");
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
existingOneToOneRoomId: this.getExistingOneToOneRoomId()
|
existingOneToOneRoomId: this.getExistingOneToOneRoomId()
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
// only display the devices list if our client supports E2E *and* the
|
|
||||||
// feature is enabled in the user settings
|
|
||||||
this._enableDevices = MatrixClientPeg.get().isCryptoEnabled() &&
|
|
||||||
UserSettingsStore.isFeatureEnabled("e2e_encryption");
|
|
||||||
|
|
||||||
this._updateStateForNewMember(this.props.member);
|
this._updateStateForNewMember(this.props.member);
|
||||||
MatrixClientPeg.get().on("deviceVerificationChanged", this.onDeviceVerificationChanged);
|
MatrixClientPeg.get().on("deviceVerificationChanged", this.onDeviceVerificationChanged);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user