You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-31 13:44:28 +03:00
Use crypto.isCrossSigningReady
in CrossSigningPanel
(#11080)
This commit is contained in:
@ -102,7 +102,7 @@ export default class CrossSigningPanel extends React.PureComponent<{}, IState> {
|
|||||||
const homeserverSupportsCrossSigning = await cli.doesServerSupportUnstableFeature(
|
const homeserverSupportsCrossSigning = await cli.doesServerSupportUnstableFeature(
|
||||||
"org.matrix.e2e_cross_signing",
|
"org.matrix.e2e_cross_signing",
|
||||||
);
|
);
|
||||||
const crossSigningReady = await cli.isCrossSigningReady();
|
const crossSigningReady = await crypto.isCrossSigningReady();
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
crossSigningPublicKeysOnDevice,
|
crossSigningPublicKeysOnDevice,
|
||||||
|
@ -59,10 +59,6 @@ describe("<CrossSigningPanel />", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("when cross signing is ready", () => {
|
describe("when cross signing is ready", () => {
|
||||||
beforeEach(() => {
|
|
||||||
mockClient.isCrossSigningReady.mockResolvedValue(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should render when keys are not backed up", async () => {
|
it("should render when keys are not backed up", async () => {
|
||||||
getComponent();
|
getComponent();
|
||||||
await flushPromises();
|
await flushPromises();
|
||||||
@ -93,7 +89,7 @@ describe("<CrossSigningPanel />", () => {
|
|||||||
|
|
||||||
describe("when cross signing is not ready", () => {
|
describe("when cross signing is not ready", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
mockClient.isCrossSigningReady.mockResolvedValue(false);
|
mocked(mockClient.getCrypto()!.isCrossSigningReady).mockResolvedValue(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render when keys are not backed up", async () => {
|
it("should render when keys are not backed up", async () => {
|
||||||
|
@ -167,5 +167,6 @@ export const mockClientMethodsCrypto = (): Partial<
|
|||||||
userSigningKey: true,
|
userSigningKey: true,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
isCrossSigningReady: jest.fn().mockResolvedValue(true),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user