1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

detect other end cancelling and reject main promise

This commit is contained in:
Bruno Windels
2019-11-04 14:38:24 +01:00
parent 9140d5a091
commit 37558ac1b4

View File

@@ -151,6 +151,10 @@ export default class VerificationBase extends EventEmitter {
this._rejectEvent = undefined;
this._resetTimer();
this._resolveEvent(e);
} else if (e.getType() === "m.key.verification.cancel") {
const reject = this._reject;
this._reject = undefined;
reject(new Error("Other side cancelled verification"));
} else {
const exception = new Error(
"Unexpected message: expecting " + this._expectedEvent