mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 01:35:49 +03:00
Cypress: fix dodgy use of string as event name (#10963)
This commit is contained in:
parent
b7cd1f00fc
commit
f9e99ed302
1 changed files with 3 additions and 0 deletions
|
@ -49,12 +49,15 @@ export function waitForVerificationRequest(cli: MatrixClient): Promise<Verificat
|
|||
export function handleVerificationRequest(request: VerificationRequest): Promise<EmojiMapping[]> {
|
||||
return new Promise<EmojiMapping[]>((resolve) => {
|
||||
const onShowSas = (event: ISasEvent) => {
|
||||
// @ts-ignore VerifierEvent is a pain to get at here as we don't have a reference to matrixcs;
|
||||
// using the string value here
|
||||
verifier.off("show_sas", onShowSas);
|
||||
event.confirm();
|
||||
resolve(event.sas.emoji);
|
||||
};
|
||||
|
||||
const verifier = request.beginKeyVerification("m.sas.v1");
|
||||
// @ts-ignore as above, avoiding reference to VerifierEvent
|
||||
verifier.on("show_sas", onShowSas);
|
||||
verifier.verify();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue