Use new getCrossSigningKeyId instead of old getCrossSigningId (#10885)

* Use new `getCrossSigningKeyId` instead of old `getCrossSigningId`

* Fix type error
This commit is contained in:
Richard van der Hoff 2023-05-15 19:30:43 +01:00 committed by GitHub
parent 77d18f1a43
commit 38c13509fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 15 deletions

View file

@ -150,7 +150,7 @@ export class SetupEncryptionStore extends EventEmitter {
}).catch(reject);
});
if (cli.getCrossSigningId()) {
if (await cli.getCrypto()?.getCrossSigningKeyId()) {
this.phase = Phase.Done;
this.emit("update");
}
@ -164,9 +164,9 @@ export class SetupEncryptionStore extends EventEmitter {
}
}
private onUserTrustStatusChanged = (userId: string): void => {
private onUserTrustStatusChanged = async (userId: string): Promise<void> => {
if (userId !== MatrixClientPeg.get().getUserId()) return;
const publicKeysTrusted = MatrixClientPeg.get().getCrossSigningId();
const publicKeysTrusted = await MatrixClientPeg.get().getCrypto()?.getCrossSigningKeyId();
if (publicKeysTrusted) {
this.phase = Phase.Done;
this.emit("update");
@ -177,7 +177,7 @@ export class SetupEncryptionStore extends EventEmitter {
this.setActiveVerificationRequest(request);
};
public onVerificationRequestChange = (): void => {
public onVerificationRequestChange = async (): Promise<void> => {
if (this.verificationRequest?.cancelled) {
this.verificationRequest.off(VerificationRequestEvent.Change, this.onVerificationRequestChange);
this.verificationRequest = null;
@ -188,7 +188,7 @@ export class SetupEncryptionStore extends EventEmitter {
// At this point, the verification has finished, we just need to wait for
// cross signing to be ready to use, so wait for the user trust status to
// change (or change to DONE if it's already ready).
const publicKeysTrusted = MatrixClientPeg.get().getCrossSigningId();
const publicKeysTrusted = await MatrixClientPeg.get().getCrypto()?.getCrossSigningKeyId();
this.phase = publicKeysTrusted ? Phase.Done : Phase.Busy;
this.emit("update");
}