1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Misc cleanup

This commit is contained in:
Travis Ralston
2020-01-29 14:52:04 +00:00
parent be345a523f
commit 0d7aee2c36

View File

@@ -59,10 +59,10 @@ export class ReciprocateQRCode extends Base {
const targetUserId = this.startEvent.getSender(); const targetUserId = this.startEvent.getSender();
if (!this.userId) { if (!this.userId) {
console.log("Asking to confirm user ID"); console.log("Asking to confirm user ID");
await new Promise((resolve, reject) => { this.userId = await new Promise((resolve, reject) => {
this.emit("confirm_user_id", { this.emit("confirm_user_id", {
userId: targetUserId, userId: targetUserId,
confirm: resolve, confirm: resolve, // takes a userId
cancel: () => reject(newUserMismatchError()), cancel: () => reject(newUserMismatchError()),
}); });
}); });
@@ -73,12 +73,8 @@ export class ReciprocateQRCode extends Base {
}); });
} }
console.log(this.request);
if (this.startEvent.getContent()['secret'] !== this.request.encodedSharedSecret) { if (this.startEvent.getContent()['secret'] !== this.request.encodedSharedSecret) {
throw newKeyMismatchError(); throw newKeyMismatchError();
} }
const requestEvent = this.request.requestEvent;
if (!requestEvent) throw new Error("Missing request event, somehow");
} }
} }