mirror of https://github.com/vector-im/riot-web
Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `MemberTile.tsx`
parent
92405c39fc
commit
f227ac8205
|
@ -49,12 +49,12 @@ export default class MemberTile extends React.Component<IProps, IState> {
|
|||
};
|
||||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
public async componentDidMount(): Promise<void> {
|
||||
const cli = MatrixClientPeg.safeGet();
|
||||
|
||||
const { roomId } = this.props.member;
|
||||
if (roomId) {
|
||||
const isRoomEncrypted = cli.isRoomEncrypted(roomId);
|
||||
const isRoomEncrypted = Boolean(await cli.getCrypto()?.isEncryptionEnabledInRoom(roomId));
|
||||
this.setState({
|
||||
isRoomEncrypted,
|
||||
});
|
||||
|
|
|
@ -31,6 +31,7 @@ import {
|
|||
filterConsole,
|
||||
flushPromises,
|
||||
getMockClientWithEventEmitter,
|
||||
mockClientMethodsCrypto,
|
||||
mockClientMethodsRooms,
|
||||
mockClientMethodsUser,
|
||||
} from "../../../../test-utils";
|
||||
|
@ -361,6 +362,7 @@ describe("MemberList", () => {
|
|||
client = getMockClientWithEventEmitter({
|
||||
...mockClientMethodsUser(),
|
||||
...mockClientMethodsRooms(),
|
||||
...mockClientMethodsCrypto(),
|
||||
getRoom: jest.fn(),
|
||||
hasLazyLoadMembersEnabled: jest.fn(),
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@ describe("MemberTile", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
matrixClient = TestUtils.stubClient();
|
||||
mocked(matrixClient.isRoomEncrypted).mockReturnValue(true);
|
||||
jest.spyOn(matrixClient.getCrypto()!, "isEncryptionEnabledInRoom").mockResolvedValue(true);
|
||||
member = new RoomMember("roomId", matrixClient.getUserId()!);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue