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

Commit

Permalink
Attach an onChange listener to the room's blacklist devices option
Browse files Browse the repository at this point in the history
Fixes element-hq/element-web#9235

The global option in user settings is unaffected by this bug. Users who have previously set the per-room flag without success can simply refresh the page and the change will be picked up. The bug here is that the current session would not update accordingly, however.

Introduced in #2523
  • Loading branch information
turt2live committed Mar 22, 2019
1 parent 140e0d6 commit 50614fa
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ export default class SecurityRoomSettingsTab extends React.Component {
});
};

_updateBlacklistDevicesFlag = (checked) => {
MatrixClientPeg.get().getRoom(this.props.roomId).setBlacklistUnverifiedDevices(checked);
};

_renderRoomAccess() {
const client = MatrixClientPeg.get();
const room = client.getRoom(this.props.roomId);
Expand Down Expand Up @@ -318,6 +322,7 @@ export default class SecurityRoomSettingsTab extends React.Component {
let encryptionSettings = null;
if (isEncrypted) {
encryptionSettings = <SettingsFlag name="blacklistUnverifiedDevices" level={SettingLevel.ROOM_DEVICE}
onChange={this._updateBlacklistDevicesFlag}
roomId={this.props.roomId} />;
}

Expand Down

0 comments on commit 50614fa

Please sign in to comment.