mirror of https://github.com/vector-im/riot-web
Cypress: fix dodgy use of string as event name (#10963)
parent
b7cd1f00fc
commit
f9e99ed302
|
@ -49,12 +49,15 @@ export function waitForVerificationRequest(cli: MatrixClient): Promise<Verificat
|
||||||
export function handleVerificationRequest(request: VerificationRequest): Promise<EmojiMapping[]> {
|
export function handleVerificationRequest(request: VerificationRequest): Promise<EmojiMapping[]> {
|
||||||
return new Promise<EmojiMapping[]>((resolve) => {
|
return new Promise<EmojiMapping[]>((resolve) => {
|
||||||
const onShowSas = (event: ISasEvent) => {
|
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);
|
verifier.off("show_sas", onShowSas);
|
||||||
event.confirm();
|
event.confirm();
|
||||||
resolve(event.sas.emoji);
|
resolve(event.sas.emoji);
|
||||||
};
|
};
|
||||||
|
|
||||||
const verifier = request.beginKeyVerification("m.sas.v1");
|
const verifier = request.beginKeyVerification("m.sas.v1");
|
||||||
|
// @ts-ignore as above, avoiding reference to VerifierEvent
|
||||||
verifier.on("show_sas", onShowSas);
|
verifier.on("show_sas", onShowSas);
|
||||||
verifier.verify();
|
verifier.verify();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue