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

Roll back change to device isolation mode #104

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/settings/controllers/DeviceIsolationModeController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ export default class DeviceIsolationModeController extends SettingController {
* @param settingValue - value of the "exclude_insecure_devices" setting.
*/
export function setDeviceIsolationMode(client: MatrixClient, settingValue: boolean): void {
client
.getCrypto()
?.setDeviceIsolationMode(
settingValue ? new OnlySignedDevicesIsolationMode() : new AllDevicesIsolationMode(true),
);
client.getCrypto()?.setDeviceIsolationMode(
settingValue
? new OnlySignedDevicesIsolationMode()
: // TODO: As part of https://github.com/element-hq/element-meta/issues/2492, we will change
// `errorOnVerifiedUserProblems` to `true`, but we need to have better UI in place before we can do so.
new AllDevicesIsolationMode(false),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe("DeviceIsolationModeController", () => {
const cli = stubClient();
const controller = new DeviceIsolationModeController();
controller.onChange(SettingLevel.DEVICE, "", false);
expect(cli.getCrypto()?.setDeviceIsolationMode).toHaveBeenCalledWith(new AllDevicesIsolationMode(true));
expect(cli.getCrypto()?.setDeviceIsolationMode).toHaveBeenCalledWith(new AllDevicesIsolationMode(false));
});
});
});
Loading